imate
C++/CUDA Reference
py_c_matrix.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.36 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "CYTHON_EXTERN_C",
9  "extern \"C\""
10  ],
11  [
12  "CYTHON_EXTERN_C",
13  "extern \"C\""
14  ],
15  [
16  "CYTHON_EXTERN_C",
17  "extern \"C\""
18  ],
19  [
20  "CYTHON_EXTERN_C",
21  "extern \"C\""
22  ],
23  [
24  "CYTHON_EXTERN_C",
25  "extern \"C\""
26  ],
27  [
28  "CYTHON_EXTERN_C",
29  "extern \"C\""
30  ],
31  [
32  "CYTHON_EXTERN_C",
33  "extern \"C\""
34  ],
35  [
36  "CYTHON_EXTERN_C",
37  "extern \"C\""
38  ],
39  [
40  "CYTHON_EXTERN_C",
41  "extern \"C\""
42  ],
43  [
44  "CYTHON_EXTERN_C",
45  "extern \"C\""
46  ],
47  [
48  "CYTHON_EXTERN_C",
49  "extern \"C\""
50  ],
51  [
52  "CYTHON_EXTERN_C",
53  "extern \"C\""
54  ],
55  [
56  "CYTHON_EXTERN_C",
57  "extern \"C\""
58  ],
59  [
60  "CYTHON_EXTERN_C",
61  "extern \"C\""
62  ],
63  [
64  "CYTHON_EXTERN_C",
65  "extern \"C\""
66  ]
67  ],
68  "depends": [
69  "imate/_c_linear_operator/c_csc_matrix.h",
70  "imate/_c_linear_operator/c_csr_matrix.h",
71  "imate/_c_linear_operator/c_dense_matrix.h",
72  "imate/_c_linear_operator/c_linear_operator.h",
73  "imate/_c_linear_operator/c_matrix.h",
74  "imate/_definitions/definitions.h"
75  ],
76  "include_dirs": [
77  "./imate/_c_linear_operator",
78  "./imate/_definitions",
79  "i",
80  "m",
81  "a",
82  "t",
83  "e",
84  "/",
85  "_",
86  "c",
87  "b",
88  "s",
89  "l",
90  "g",
91  "r"
92  ],
93  "language": "c++",
94  "name": "imate._c_linear_operator.py_c_matrix",
95  "sources": [
96  "./imate/_c_linear_operator/py_c_matrix.pyx",
97  "./imate/_c_linear_operator/c_csc_matrix.cpp",
98  "./imate/_c_linear_operator/c_linear_operator.cpp",
99  "./imate/_c_linear_operator/c_matrix.cpp",
100  "./imate/_c_linear_operator/c_affine_matrix_function.cpp",
101  "./imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
102  "./imate/_c_linear_operator/c_csr_matrix.cpp",
103  "./imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
104  "./imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
105  "./imate/_c_linear_operator/c_dense_matrix.cpp",
106  "imate/_c_basic_algebra/c_vector_operations.cpp",
107  "imate/_c_basic_algebra/c_matrix_operations.cpp",
108  "imate/_c_basic_algebra/cblas_interface.cpp"
109  ]
110  },
111  "module_name": "imate._c_linear_operator.py_c_matrix"
112 }
113 END: Cython Metadata */
114 
115 #ifndef PY_SSIZE_T_CLEAN
116 #define PY_SSIZE_T_CLEAN
117 #endif /* PY_SSIZE_T_CLEAN */
118 #include "Python.h"
119 #ifndef Py_PYTHON_H
120  #error Python headers needed to compile C extensions, please install development version of Python.
121 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
122  #error Cython requires Python 2.6+ or Python 3.3+.
123 #else
124 #define CYTHON_ABI "0_29_36"
125 #define CYTHON_HEX_VERSION 0x001D24F0
126 #define CYTHON_FUTURE_DIVISION 1
127 #include <stddef.h>
128 #ifndef offsetof
129  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
130 #endif
131 #if !defined(WIN32) && !defined(MS_WINDOWS)
132  #ifndef __stdcall
133  #define __stdcall
134  #endif
135  #ifndef __cdecl
136  #define __cdecl
137  #endif
138  #ifndef __fastcall
139  #define __fastcall
140  #endif
141 #endif
142 #ifndef DL_IMPORT
143  #define DL_IMPORT(t) t
144 #endif
145 #ifndef DL_EXPORT
146  #define DL_EXPORT(t) t
147 #endif
148 #define __PYX_COMMA ,
149 #ifndef HAVE_LONG_LONG
150  #if PY_VERSION_HEX >= 0x02070000
151  #define HAVE_LONG_LONG
152  #endif
153 #endif
154 #ifndef PY_LONG_LONG
155  #define PY_LONG_LONG LONG_LONG
156 #endif
157 #ifndef Py_HUGE_VAL
158  #define Py_HUGE_VAL HUGE_VAL
159 #endif
160 #ifdef PYPY_VERSION
161  #define CYTHON_COMPILING_IN_PYPY 1
162  #define CYTHON_COMPILING_IN_PYSTON 0
163  #define CYTHON_COMPILING_IN_CPYTHON 0
164  #define CYTHON_COMPILING_IN_NOGIL 0
165  #undef CYTHON_USE_TYPE_SLOTS
166  #define CYTHON_USE_TYPE_SLOTS 0
167  #undef CYTHON_USE_PYTYPE_LOOKUP
168  #define CYTHON_USE_PYTYPE_LOOKUP 0
169  #if PY_VERSION_HEX < 0x03050000
170  #undef CYTHON_USE_ASYNC_SLOTS
171  #define CYTHON_USE_ASYNC_SLOTS 0
172  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
173  #define CYTHON_USE_ASYNC_SLOTS 1
174  #endif
175  #undef CYTHON_USE_PYLIST_INTERNALS
176  #define CYTHON_USE_PYLIST_INTERNALS 0
177  #undef CYTHON_USE_UNICODE_INTERNALS
178  #define CYTHON_USE_UNICODE_INTERNALS 0
179  #undef CYTHON_USE_UNICODE_WRITER
180  #define CYTHON_USE_UNICODE_WRITER 0
181  #undef CYTHON_USE_PYLONG_INTERNALS
182  #define CYTHON_USE_PYLONG_INTERNALS 0
183  #undef CYTHON_AVOID_BORROWED_REFS
184  #define CYTHON_AVOID_BORROWED_REFS 1
185  #undef CYTHON_ASSUME_SAFE_MACROS
186  #define CYTHON_ASSUME_SAFE_MACROS 0
187  #undef CYTHON_UNPACK_METHODS
188  #define CYTHON_UNPACK_METHODS 0
189  #undef CYTHON_FAST_THREAD_STATE
190  #define CYTHON_FAST_THREAD_STATE 0
191  #undef CYTHON_FAST_PYCALL
192  #define CYTHON_FAST_PYCALL 0
193  #if PY_VERSION_HEX < 0x03090000
194  #undef CYTHON_PEP489_MULTI_PHASE_INIT
195  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
196  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
197  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
198  #endif
199  #undef CYTHON_USE_TP_FINALIZE
200  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
201  #undef CYTHON_USE_DICT_VERSIONS
202  #define CYTHON_USE_DICT_VERSIONS 0
203  #undef CYTHON_USE_EXC_INFO_STACK
204  #define CYTHON_USE_EXC_INFO_STACK 0
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
207  #endif
208 #elif defined(PYSTON_VERSION)
209  #define CYTHON_COMPILING_IN_PYPY 0
210  #define CYTHON_COMPILING_IN_PYSTON 1
211  #define CYTHON_COMPILING_IN_CPYTHON 0
212  #define CYTHON_COMPILING_IN_NOGIL 0
213  #ifndef CYTHON_USE_TYPE_SLOTS
214  #define CYTHON_USE_TYPE_SLOTS 1
215  #endif
216  #undef CYTHON_USE_PYTYPE_LOOKUP
217  #define CYTHON_USE_PYTYPE_LOOKUP 0
218  #undef CYTHON_USE_ASYNC_SLOTS
219  #define CYTHON_USE_ASYNC_SLOTS 0
220  #undef CYTHON_USE_PYLIST_INTERNALS
221  #define CYTHON_USE_PYLIST_INTERNALS 0
222  #ifndef CYTHON_USE_UNICODE_INTERNALS
223  #define CYTHON_USE_UNICODE_INTERNALS 1
224  #endif
225  #undef CYTHON_USE_UNICODE_WRITER
226  #define CYTHON_USE_UNICODE_WRITER 0
227  #undef CYTHON_USE_PYLONG_INTERNALS
228  #define CYTHON_USE_PYLONG_INTERNALS 0
229  #ifndef CYTHON_AVOID_BORROWED_REFS
230  #define CYTHON_AVOID_BORROWED_REFS 0
231  #endif
232  #ifndef CYTHON_ASSUME_SAFE_MACROS
233  #define CYTHON_ASSUME_SAFE_MACROS 1
234  #endif
235  #ifndef CYTHON_UNPACK_METHODS
236  #define CYTHON_UNPACK_METHODS 1
237  #endif
238  #undef CYTHON_FAST_THREAD_STATE
239  #define CYTHON_FAST_THREAD_STATE 0
240  #undef CYTHON_FAST_PYCALL
241  #define CYTHON_FAST_PYCALL 0
242  #undef CYTHON_PEP489_MULTI_PHASE_INIT
243  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
244  #undef CYTHON_USE_TP_FINALIZE
245  #define CYTHON_USE_TP_FINALIZE 0
246  #undef CYTHON_USE_DICT_VERSIONS
247  #define CYTHON_USE_DICT_VERSIONS 0
248  #undef CYTHON_USE_EXC_INFO_STACK
249  #define CYTHON_USE_EXC_INFO_STACK 0
250  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
251  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
252  #endif
253 #elif defined(PY_NOGIL)
254  #define CYTHON_COMPILING_IN_PYPY 0
255  #define CYTHON_COMPILING_IN_PYSTON 0
256  #define CYTHON_COMPILING_IN_CPYTHON 0
257  #define CYTHON_COMPILING_IN_NOGIL 1
258  #ifndef CYTHON_USE_TYPE_SLOTS
259  #define CYTHON_USE_TYPE_SLOTS 1
260  #endif
261  #undef CYTHON_USE_PYTYPE_LOOKUP
262  #define CYTHON_USE_PYTYPE_LOOKUP 0
263  #ifndef CYTHON_USE_ASYNC_SLOTS
264  #define CYTHON_USE_ASYNC_SLOTS 1
265  #endif
266  #undef CYTHON_USE_PYLIST_INTERNALS
267  #define CYTHON_USE_PYLIST_INTERNALS 0
268  #ifndef CYTHON_USE_UNICODE_INTERNALS
269  #define CYTHON_USE_UNICODE_INTERNALS 1
270  #endif
271  #undef CYTHON_USE_UNICODE_WRITER
272  #define CYTHON_USE_UNICODE_WRITER 0
273  #undef CYTHON_USE_PYLONG_INTERNALS
274  #define CYTHON_USE_PYLONG_INTERNALS 0
275  #ifndef CYTHON_AVOID_BORROWED_REFS
276  #define CYTHON_AVOID_BORROWED_REFS 0
277  #endif
278  #ifndef CYTHON_ASSUME_SAFE_MACROS
279  #define CYTHON_ASSUME_SAFE_MACROS 1
280  #endif
281  #ifndef CYTHON_UNPACK_METHODS
282  #define CYTHON_UNPACK_METHODS 1
283  #endif
284  #undef CYTHON_FAST_THREAD_STATE
285  #define CYTHON_FAST_THREAD_STATE 0
286  #undef CYTHON_FAST_PYCALL
287  #define CYTHON_FAST_PYCALL 0
288  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
289  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
290  #endif
291  #ifndef CYTHON_USE_TP_FINALIZE
292  #define CYTHON_USE_TP_FINALIZE 1
293  #endif
294  #undef CYTHON_USE_DICT_VERSIONS
295  #define CYTHON_USE_DICT_VERSIONS 0
296  #undef CYTHON_USE_EXC_INFO_STACK
297  #define CYTHON_USE_EXC_INFO_STACK 0
298 #else
299  #define CYTHON_COMPILING_IN_PYPY 0
300  #define CYTHON_COMPILING_IN_PYSTON 0
301  #define CYTHON_COMPILING_IN_CPYTHON 1
302  #define CYTHON_COMPILING_IN_NOGIL 0
303  #ifndef CYTHON_USE_TYPE_SLOTS
304  #define CYTHON_USE_TYPE_SLOTS 1
305  #endif
306  #if PY_VERSION_HEX < 0x02070000
307  #undef CYTHON_USE_PYTYPE_LOOKUP
308  #define CYTHON_USE_PYTYPE_LOOKUP 0
309  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
310  #define CYTHON_USE_PYTYPE_LOOKUP 1
311  #endif
312  #if PY_MAJOR_VERSION < 3
313  #undef CYTHON_USE_ASYNC_SLOTS
314  #define CYTHON_USE_ASYNC_SLOTS 0
315  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
316  #define CYTHON_USE_ASYNC_SLOTS 1
317  #endif
318  #if PY_VERSION_HEX < 0x02070000
319  #undef CYTHON_USE_PYLONG_INTERNALS
320  #define CYTHON_USE_PYLONG_INTERNALS 0
321  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
322  #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
323  #endif
324  #ifndef CYTHON_USE_PYLIST_INTERNALS
325  #define CYTHON_USE_PYLIST_INTERNALS 1
326  #endif
327  #ifndef CYTHON_USE_UNICODE_INTERNALS
328  #define CYTHON_USE_UNICODE_INTERNALS 1
329  #endif
330  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
331  #undef CYTHON_USE_UNICODE_WRITER
332  #define CYTHON_USE_UNICODE_WRITER 0
333  #elif !defined(CYTHON_USE_UNICODE_WRITER)
334  #define CYTHON_USE_UNICODE_WRITER 1
335  #endif
336  #ifndef CYTHON_AVOID_BORROWED_REFS
337  #define CYTHON_AVOID_BORROWED_REFS 0
338  #endif
339  #ifndef CYTHON_ASSUME_SAFE_MACROS
340  #define CYTHON_ASSUME_SAFE_MACROS 1
341  #endif
342  #ifndef CYTHON_UNPACK_METHODS
343  #define CYTHON_UNPACK_METHODS 1
344  #endif
345  #if PY_VERSION_HEX >= 0x030B00A4
346  #undef CYTHON_FAST_THREAD_STATE
347  #define CYTHON_FAST_THREAD_STATE 0
348  #elif !defined(CYTHON_FAST_THREAD_STATE)
349  #define CYTHON_FAST_THREAD_STATE 1
350  #endif
351  #ifndef CYTHON_FAST_PYCALL
352  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
353  #endif
354  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
355  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
356  #endif
357  #ifndef CYTHON_USE_TP_FINALIZE
358  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
359  #endif
360  #ifndef CYTHON_USE_DICT_VERSIONS
361  #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
362  #endif
363  #if PY_VERSION_HEX >= 0x030B00A4
364  #undef CYTHON_USE_EXC_INFO_STACK
365  #define CYTHON_USE_EXC_INFO_STACK 0
366  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
367  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
368  #endif
369  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
370  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
371  #endif
372 #endif
373 #if !defined(CYTHON_FAST_PYCCALL)
374 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
375 #endif
376 #if CYTHON_USE_PYLONG_INTERNALS
377  #if PY_MAJOR_VERSION < 3
378  #include "longintrepr.h"
379  #endif
380  #undef SHIFT
381  #undef BASE
382  #undef MASK
383  #ifdef SIZEOF_VOID_P
384  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
385  #endif
386 #endif
387 #ifndef __has_attribute
388  #define __has_attribute(x) 0
389 #endif
390 #ifndef __has_cpp_attribute
391  #define __has_cpp_attribute(x) 0
392 #endif
393 #ifndef CYTHON_RESTRICT
394  #if defined(__GNUC__)
395  #define CYTHON_RESTRICT __restrict__
396  #elif defined(_MSC_VER) && _MSC_VER >= 1400
397  #define CYTHON_RESTRICT __restrict
398  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
399  #define CYTHON_RESTRICT restrict
400  #else
401  #define CYTHON_RESTRICT
402  #endif
403 #endif
404 #ifndef CYTHON_UNUSED
405 # if defined(__GNUC__)
406 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
407 # define CYTHON_UNUSED __attribute__ ((__unused__))
408 # else
409 # define CYTHON_UNUSED
410 # endif
411 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
412 # define CYTHON_UNUSED __attribute__ ((__unused__))
413 # else
414 # define CYTHON_UNUSED
415 # endif
416 #endif
417 #ifndef CYTHON_MAYBE_UNUSED_VAR
418 # if defined(__cplusplus)
419  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
420 # else
421 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
422 # endif
423 #endif
424 #ifndef CYTHON_NCP_UNUSED
425 # if CYTHON_COMPILING_IN_CPYTHON
426 # define CYTHON_NCP_UNUSED
427 # else
428 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
429 # endif
430 #endif
431 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
432 #ifdef _MSC_VER
433  #ifndef _MSC_STDINT_H_
434  #if _MSC_VER < 1300
435  typedef unsigned char uint8_t;
436  typedef unsigned int uint32_t;
437  #else
438  typedef unsigned __int8 uint8_t;
439  typedef unsigned __int32 uint32_t;
440  #endif
441  #endif
442 #else
443  #include <stdint.h>
444 #endif
445 #ifndef CYTHON_FALLTHROUGH
446  #if defined(__cplusplus) && __cplusplus >= 201103L
447  #if __has_cpp_attribute(fallthrough)
448  #define CYTHON_FALLTHROUGH [[fallthrough]]
449  #elif __has_cpp_attribute(clang::fallthrough)
450  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
451  #elif __has_cpp_attribute(gnu::fallthrough)
452  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
453  #endif
454  #endif
455  #ifndef CYTHON_FALLTHROUGH
456  #if __has_attribute(fallthrough)
457  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
458  #else
459  #define CYTHON_FALLTHROUGH
460  #endif
461  #endif
462  #if defined(__clang__ ) && defined(__apple_build_version__)
463  #if __apple_build_version__ < 7000000
464  #undef CYTHON_FALLTHROUGH
465  #define CYTHON_FALLTHROUGH
466  #endif
467  #endif
468 #endif
469 
470 #ifndef __cplusplus
471  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
472 #endif
473 #ifndef CYTHON_INLINE
474  #if defined(__clang__)
475  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
476  #else
477  #define CYTHON_INLINE inline
478  #endif
479 #endif
480 template<typename T>
481 void __Pyx_call_destructor(T& x) {
482  x.~T();
483 }
484 template<typename T>
485 class __Pyx_FakeReference {
486  public:
487  __Pyx_FakeReference() : ptr(NULL) { }
488  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
489  T *operator->() { return ptr; }
490  T *operator&() { return ptr; }
491  operator T&() { return *ptr; }
492  template<typename U> bool operator ==(U other) { return *ptr == other; }
493  template<typename U> bool operator !=(U other) { return *ptr != other; }
494  private:
495  T *ptr;
496 };
497 
498 #define __PYX_BUILD_PY_SSIZE_T "n"
499 #define CYTHON_FORMAT_SSIZE_T "z"
500 #if PY_MAJOR_VERSION < 3
501  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
502  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
503  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
504  #define __Pyx_DefaultClassType PyClass_Type
505 #else
506  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
507  #define __Pyx_DefaultClassType PyType_Type
508 #if PY_VERSION_HEX >= 0x030B00A1
509  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
510  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
511  PyObject *fv, PyObject *cell, PyObject* fn,
512  PyObject *name, int fline, PyObject *lnos) {
513  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
514  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
515  const char *fn_cstr=NULL;
516  const char *name_cstr=NULL;
517  PyCodeObject* co=NULL;
518  PyObject *type, *value, *traceback;
519  PyErr_Fetch(&type, &value, &traceback);
520  if (!(kwds=PyDict_New())) goto end;
521  if (!(argcount=PyLong_FromLong(a))) goto end;
522  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
523  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
524  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
525  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
526  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
527  if (!(nlocals=PyLong_FromLong(l))) goto end;
528  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
529  if (!(stacksize=PyLong_FromLong(s))) goto end;
530  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
531  if (!(flags=PyLong_FromLong(f))) goto end;
532  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
533  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
534  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
535  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
536  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
537  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
538  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
539  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
540  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
541  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
542  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
543  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
544  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
545  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
546  Py_XDECREF((PyObject*)co);
547  co = (PyCodeObject*)call_result;
548  call_result = NULL;
549  if (0) {
550  cleanup_code_too:
551  Py_XDECREF((PyObject*)co);
552  co = NULL;
553  }
554  end:
555  Py_XDECREF(kwds);
556  Py_XDECREF(argcount);
557  Py_XDECREF(posonlyargcount);
558  Py_XDECREF(kwonlyargcount);
559  Py_XDECREF(nlocals);
560  Py_XDECREF(stacksize);
561  Py_XDECREF(replace);
562  Py_XDECREF(call_result);
563  Py_XDECREF(empty);
564  if (type) {
565  PyErr_Restore(type, value, traceback);
566  }
567  return co;
568  }
569 #else
570  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
571  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
572 #endif
573  #define __Pyx_DefaultClassType PyType_Type
574 #endif
575 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
576  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
577 #else
578  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
579 #endif
580 #ifndef Py_TPFLAGS_CHECKTYPES
581  #define Py_TPFLAGS_CHECKTYPES 0
582 #endif
583 #ifndef Py_TPFLAGS_HAVE_INDEX
584  #define Py_TPFLAGS_HAVE_INDEX 0
585 #endif
586 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
587  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
588 #endif
589 #ifndef Py_TPFLAGS_HAVE_FINALIZE
590  #define Py_TPFLAGS_HAVE_FINALIZE 0
591 #endif
592 #ifndef METH_STACKLESS
593  #define METH_STACKLESS 0
594 #endif
595 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
596  #ifndef METH_FASTCALL
597  #define METH_FASTCALL 0x80
598  #endif
599  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
600  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
601  Py_ssize_t nargs, PyObject *kwnames);
602 #else
603  #define __Pyx_PyCFunctionFast _PyCFunctionFast
604  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
605 #endif
606 #if CYTHON_FAST_PYCCALL
607 #define __Pyx_PyFastCFunction_Check(func)\
608  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
609 #else
610 #define __Pyx_PyFastCFunction_Check(func) 0
611 #endif
612 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
613  #define PyObject_Malloc(s) PyMem_Malloc(s)
614  #define PyObject_Free(p) PyMem_Free(p)
615  #define PyObject_Realloc(p) PyMem_Realloc(p)
616 #endif
617 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
618  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
619  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
620  #define PyMem_RawFree(p) PyMem_Free(p)
621 #endif
622 #if CYTHON_COMPILING_IN_PYSTON
623  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
624  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
625 #else
626  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
627  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
628 #endif
629 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
630  #define __Pyx_PyThreadState_Current PyThreadState_GET()
631 #elif PY_VERSION_HEX >= 0x03060000
632  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
633 #elif PY_VERSION_HEX >= 0x03000000
634  #define __Pyx_PyThreadState_Current PyThreadState_GET()
635 #else
636  #define __Pyx_PyThreadState_Current _PyThreadState_Current
637 #endif
638 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
639 #include "pythread.h"
640 #define Py_tss_NEEDS_INIT 0
641 typedef int Py_tss_t;
642 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
643  *key = PyThread_create_key();
644  return 0;
645 }
646 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
647  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
648  *key = Py_tss_NEEDS_INIT;
649  return key;
650 }
651 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
652  PyObject_Free(key);
653 }
654 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
655  return *key != Py_tss_NEEDS_INIT;
656 }
657 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
658  PyThread_delete_key(*key);
659  *key = Py_tss_NEEDS_INIT;
660 }
661 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
662  return PyThread_set_key_value(*key, value);
663 }
664 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
665  return PyThread_get_key_value(*key);
666 }
667 #endif
668 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
669 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
670 #else
671 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
672 #endif
673 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
674  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
675  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
676 #else
677  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
678  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
679 #endif
680 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
681 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
682 #else
683 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
684 #endif
685 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
686  #define CYTHON_PEP393_ENABLED 1
687  #if PY_VERSION_HEX >= 0x030C0000
688  #define __Pyx_PyUnicode_READY(op) (0)
689  #else
690  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
691  0 : _PyUnicode_Ready((PyObject *)(op)))
692  #endif
693  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
694  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
695  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
696  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
697  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
698  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
699  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
700  #if PY_VERSION_HEX >= 0x030C0000
701  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
702  #else
703  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
704  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
705  #else
706  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
707  #endif
708  #endif
709 #else
710  #define CYTHON_PEP393_ENABLED 0
711  #define PyUnicode_1BYTE_KIND 1
712  #define PyUnicode_2BYTE_KIND 2
713  #define PyUnicode_4BYTE_KIND 4
714  #define __Pyx_PyUnicode_READY(op) (0)
715  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
716  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
717  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
718  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
719  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
720  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
721  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
722  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
723 #endif
724 #if CYTHON_COMPILING_IN_PYPY
725  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
726  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
727 #else
728  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
729  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
730  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
731 #endif
732 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
733  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
734 #endif
735 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
736  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
737 #endif
738 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
739  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
740 #endif
741 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
742 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
743 #if PY_MAJOR_VERSION >= 3
744  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
745 #else
746  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
747 #endif
748 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
749  #define PyObject_ASCII(o) PyObject_Repr(o)
750 #endif
751 #if PY_MAJOR_VERSION >= 3
752  #define PyBaseString_Type PyUnicode_Type
753  #define PyStringObject PyUnicodeObject
754  #define PyString_Type PyUnicode_Type
755  #define PyString_Check PyUnicode_Check
756  #define PyString_CheckExact PyUnicode_CheckExact
757 #ifndef PyObject_Unicode
758  #define PyObject_Unicode PyObject_Str
759 #endif
760 #endif
761 #if PY_MAJOR_VERSION >= 3
762  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
763  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
764 #else
765  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
766  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
767 #endif
768 #ifndef PySet_CheckExact
769  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
770 #endif
771 #if PY_VERSION_HEX >= 0x030900A4
772  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
773  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
774 #else
775  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
776  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
777 #endif
778 #if CYTHON_ASSUME_SAFE_MACROS
779  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
780 #else
781  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
782 #endif
783 #if PY_MAJOR_VERSION >= 3
784  #define PyIntObject PyLongObject
785  #define PyInt_Type PyLong_Type
786  #define PyInt_Check(op) PyLong_Check(op)
787  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
788  #define PyInt_FromString PyLong_FromString
789  #define PyInt_FromUnicode PyLong_FromUnicode
790  #define PyInt_FromLong PyLong_FromLong
791  #define PyInt_FromSize_t PyLong_FromSize_t
792  #define PyInt_FromSsize_t PyLong_FromSsize_t
793  #define PyInt_AsLong PyLong_AsLong
794  #define PyInt_AS_LONG PyLong_AS_LONG
795  #define PyInt_AsSsize_t PyLong_AsSsize_t
796  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
797  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
798  #define PyNumber_Int PyNumber_Long
799 #endif
800 #if PY_MAJOR_VERSION >= 3
801  #define PyBoolObject PyLongObject
802 #endif
803 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
804  #ifndef PyUnicode_InternFromString
805  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
806  #endif
807 #endif
808 #if PY_VERSION_HEX < 0x030200A4
809  typedef long Py_hash_t;
810  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
811  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
812 #else
813  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
814  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
815 #endif
816 #if PY_MAJOR_VERSION >= 3
817  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
818 #else
819  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
820 #endif
821 #if CYTHON_USE_ASYNC_SLOTS
822  #if PY_VERSION_HEX >= 0x030500B1
823  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
824  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
825  #else
826  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
827  #endif
828 #else
829  #define __Pyx_PyType_AsAsync(obj) NULL
830 #endif
831 #ifndef __Pyx_PyAsyncMethodsStruct
832  typedef struct {
833  unaryfunc am_await;
834  unaryfunc am_aiter;
835  unaryfunc am_anext;
836  } __Pyx_PyAsyncMethodsStruct;
837 #endif
838 
839 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
840  #if !defined(_USE_MATH_DEFINES)
841  #define _USE_MATH_DEFINES
842  #endif
843 #endif
844 #include <math.h>
845 #ifdef NAN
846 #define __PYX_NAN() ((float) NAN)
847 #else
848 static CYTHON_INLINE float __PYX_NAN() {
849  float value;
850  memset(&value, 0xFF, sizeof(value));
851  return value;
852 }
853 #endif
854 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
855 #define __Pyx_truncl trunc
856 #else
857 #define __Pyx_truncl truncl
858 #endif
859 
860 #define __PYX_MARK_ERR_POS(f_index, lineno) \
861  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
862 #define __PYX_ERR(f_index, lineno, Ln_error) \
863  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
864 
865 #ifndef __PYX_EXTERN_C
866  #ifdef __cplusplus
867  #define __PYX_EXTERN_C extern "C"
868  #else
869  #define __PYX_EXTERN_C extern
870  #endif
871 #endif
872 
873 #define __PYX_HAVE__imate___c_linear_operator__py_c_matrix
874 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_matrix
875 /* Early includes */
876 #include "./definitions.h"
877 #include "ios"
878 #include "new"
879 #include "stdexcept"
880 #include "typeinfo"
881 #include "c_linear_operator.h"
882 #include "c_matrix.h"
883 #include "c_dense_matrix.h"
884 #include "c_csr_matrix.h"
885 #include "c_csc_matrix.h"
886 #include "pythread.h"
887 #include <string.h>
888 #include <stdlib.h>
889 #include <stdio.h>
890 #include "pystate.h"
891 #ifdef _OPENMP
892 #include <omp.h>
893 #endif /* _OPENMP */
894 
895 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
896 #define CYTHON_WITHOUT_ASSERTIONS
897 #endif
898 
899 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
900  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
901 
902 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
903 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
904 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
905 #define __PYX_DEFAULT_STRING_ENCODING ""
906 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
907 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
908 #define __Pyx_uchar_cast(c) ((unsigned char)c)
909 #define __Pyx_long_cast(x) ((long)x)
910 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
911  (sizeof(type) < sizeof(Py_ssize_t)) ||\
912  (sizeof(type) > sizeof(Py_ssize_t) &&\
913  likely(v < (type)PY_SSIZE_T_MAX ||\
914  v == (type)PY_SSIZE_T_MAX) &&\
915  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
916  v == (type)PY_SSIZE_T_MIN))) ||\
917  (sizeof(type) == sizeof(Py_ssize_t) &&\
918  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
919  v == (type)PY_SSIZE_T_MAX))) )
920 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
921  return (size_t) i < (size_t) limit;
922 }
923 #if defined (__cplusplus) && __cplusplus >= 201103L
924  #include <cstdlib>
925  #define __Pyx_sst_abs(value) std::abs(value)
926 #elif SIZEOF_INT >= SIZEOF_SIZE_T
927  #define __Pyx_sst_abs(value) abs(value)
928 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
929  #define __Pyx_sst_abs(value) labs(value)
930 #elif defined (_MSC_VER)
931  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
932 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
933  #define __Pyx_sst_abs(value) llabs(value)
934 #elif defined (__GNUC__)
935  #define __Pyx_sst_abs(value) __builtin_llabs(value)
936 #else
937  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
938 #endif
939 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
940 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
941 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
942 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
943 #define __Pyx_PyBytes_FromString PyBytes_FromString
944 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
945 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
946 #if PY_MAJOR_VERSION < 3
947  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
948  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
949 #else
950  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
951  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
952 #endif
953 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
954 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
955 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
956 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
957 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
958 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
959 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
960 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
961 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
962 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
963 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
964 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
965 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
966 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
967 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
968 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
969 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
970  const Py_UNICODE *u_end = u;
971  while (*u_end++) ;
972  return (size_t)(u_end - u - 1);
973 }
974 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
975 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
976 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
977 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
978 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
979 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
980 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
981 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
982 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
983 #define __Pyx_PySequence_Tuple(obj)\
984  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
985 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
986 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
987 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
988 #if CYTHON_ASSUME_SAFE_MACROS
989 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
990 #else
991 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
992 #endif
993 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
994 #if PY_MAJOR_VERSION >= 3
995 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
996 #else
997 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
998 #endif
999 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1000 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1001 static int __Pyx_sys_getdefaultencoding_not_ascii;
1002 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1003  PyObject* sys;
1004  PyObject* default_encoding = NULL;
1005  PyObject* ascii_chars_u = NULL;
1006  PyObject* ascii_chars_b = NULL;
1007  const char* default_encoding_c;
1008  sys = PyImport_ImportModule("sys");
1009  if (!sys) goto bad;
1010  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1011  Py_DECREF(sys);
1012  if (!default_encoding) goto bad;
1013  default_encoding_c = PyBytes_AsString(default_encoding);
1014  if (!default_encoding_c) goto bad;
1015  if (strcmp(default_encoding_c, "ascii") == 0) {
1016  __Pyx_sys_getdefaultencoding_not_ascii = 0;
1017  } else {
1018  char ascii_chars[128];
1019  int c;
1020  for (c = 0; c < 128; c++) {
1021  ascii_chars[c] = c;
1022  }
1023  __Pyx_sys_getdefaultencoding_not_ascii = 1;
1024  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1025  if (!ascii_chars_u) goto bad;
1026  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1027  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1028  PyErr_Format(
1029  PyExc_ValueError,
1030  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1031  default_encoding_c);
1032  goto bad;
1033  }
1034  Py_DECREF(ascii_chars_u);
1035  Py_DECREF(ascii_chars_b);
1036  }
1037  Py_DECREF(default_encoding);
1038  return 0;
1039 bad:
1040  Py_XDECREF(default_encoding);
1041  Py_XDECREF(ascii_chars_u);
1042  Py_XDECREF(ascii_chars_b);
1043  return -1;
1044 }
1045 #endif
1046 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1047 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1048 #else
1049 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1050 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1051 static char* __PYX_DEFAULT_STRING_ENCODING;
1052 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1053  PyObject* sys;
1054  PyObject* default_encoding = NULL;
1055  char* default_encoding_c;
1056  sys = PyImport_ImportModule("sys");
1057  if (!sys) goto bad;
1058  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1059  Py_DECREF(sys);
1060  if (!default_encoding) goto bad;
1061  default_encoding_c = PyBytes_AsString(default_encoding);
1062  if (!default_encoding_c) goto bad;
1063  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1064  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1065  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1066  Py_DECREF(default_encoding);
1067  return 0;
1068 bad:
1069  Py_XDECREF(default_encoding);
1070  return -1;
1071 }
1072 #endif
1073 #endif
1074 
1075 
1076 /* Test for GCC > 2.95 */
1077 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1078  #define likely(x) __builtin_expect(!!(x), 1)
1079  #define unlikely(x) __builtin_expect(!!(x), 0)
1080 #else /* !__GNUC__ or GCC < 2.95 */
1081  #define likely(x) (x)
1082  #define unlikely(x) (x)
1083 #endif /* __GNUC__ */
1084 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1085 
1086 static PyObject *__pyx_m = NULL;
1087 static PyObject *__pyx_d;
1088 static PyObject *__pyx_b;
1089 static PyObject *__pyx_cython_runtime = NULL;
1090 static PyObject *__pyx_empty_tuple;
1091 static PyObject *__pyx_empty_bytes;
1092 static PyObject *__pyx_empty_unicode;
1093 static int __pyx_lineno;
1094 static int __pyx_clineno = 0;
1095 static const char * __pyx_cfilenm= __FILE__;
1096 static const char *__pyx_filename;
1097 
1098 
1099 static const char *__pyx_f[] = {
1100  "imate/_c_linear_operator/py_c_matrix.pyx",
1101  "stringsource",
1102 };
1103 /* MemviewSliceStruct.proto */
1104 struct __pyx_memoryview_obj;
1105 typedef struct {
1106  struct __pyx_memoryview_obj *memview;
1107  char *data;
1108  Py_ssize_t shape[8];
1109  Py_ssize_t strides[8];
1110  Py_ssize_t suboffsets[8];
1111 } __Pyx_memviewslice;
1112 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1113 
1114 /* Atomics.proto */
1115 #include <pythread.h>
1116 #ifndef CYTHON_ATOMICS
1117  #define CYTHON_ATOMICS 1
1118 #endif
1119 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1120 #define __pyx_atomic_int_type int
1121 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1122  (__GNUC_MINOR__ > 1 ||\
1123  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1124  #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1125  #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1126  #ifdef __PYX_DEBUG_ATOMICS
1127  #warning "Using GNU atomics"
1128  #endif
1129 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1130  #include <intrin.h>
1131  #undef __pyx_atomic_int_type
1132  #define __pyx_atomic_int_type long
1133  #pragma intrinsic (_InterlockedExchangeAdd)
1134  #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1135  #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1136  #ifdef __PYX_DEBUG_ATOMICS
1137  #pragma message ("Using MSVC atomics")
1138  #endif
1139 #else
1140  #undef CYTHON_ATOMICS
1141  #define CYTHON_ATOMICS 0
1142  #ifdef __PYX_DEBUG_ATOMICS
1143  #warning "Not using atomics"
1144  #endif
1145 #endif
1146 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1147 #if CYTHON_ATOMICS
1148  #define __pyx_add_acquisition_count(memview)\
1149  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1150  #define __pyx_sub_acquisition_count(memview)\
1151  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1152 #else
1153  #define __pyx_add_acquisition_count(memview)\
1154  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1155  #define __pyx_sub_acquisition_count(memview)\
1156  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1157 #endif
1158 
1159 /* ForceInitThreads.proto */
1160 #ifndef __PYX_FORCE_INIT_THREADS
1161  #define __PYX_FORCE_INIT_THREADS 0
1162 #endif
1163 
1164 /* NoFastGil.proto */
1165 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1166 #define __Pyx_PyGILState_Release PyGILState_Release
1167 #define __Pyx_FastGIL_Remember()
1168 #define __Pyx_FastGIL_Forget()
1169 #define __Pyx_FastGilFuncInit()
1170 
1171 /* BufferFormatStructs.proto */
1172 #define IS_UNSIGNED(type) (((type) -1) > 0)
1173 struct __Pyx_StructField_;
1174 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1175 typedef struct {
1176  const char* name;
1177  struct __Pyx_StructField_* fields;
1178  size_t size;
1179  size_t arraysize[8];
1180  int ndim;
1181  char typegroup;
1182  char is_unsigned;
1183  int flags;
1184 } __Pyx_TypeInfo;
1185 typedef struct __Pyx_StructField_ {
1186  __Pyx_TypeInfo* type;
1187  const char* name;
1188  size_t offset;
1189 } __Pyx_StructField;
1190 typedef struct {
1191  __Pyx_StructField* field;
1192  size_t parent_offset;
1193 } __Pyx_BufFmt_StackElem;
1194 typedef struct {
1195  __Pyx_StructField root;
1196  __Pyx_BufFmt_StackElem* head;
1197  size_t fmt_offset;
1198  size_t new_count, enc_count;
1199  size_t struct_alignment;
1200  int is_complex;
1201  char enc_type;
1202  char new_packmode;
1203  char enc_packmode;
1204  char is_valid_array;
1205 } __Pyx_BufFmt_Context;
1206 
1207 
1208 /* "_definitions/types.pxd":110
1209  *
1210  * # Used for indices of small matrices, or small size iterators
1211  * ctypedef int IndexType # <<<<<<<<<<<<<<
1212  * ctypedef int[:] MemoryViewIndexType
1213  *
1214  */
1215 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1216 
1217 /* "_definitions/types.pxd":114
1218  *
1219  * # Used for both flags and integers used as signals, including negative integers
1220  * ctypedef int FlagType # <<<<<<<<<<<<<<
1221  * ctypedef int[:] MemoryViewFlagType
1222  *
1223  */
1224 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1225 
1226 /*--- Type declarations ---*/
1227 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1228 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1229 struct __pyx_array_obj;
1230 struct __pyx_MemviewEnum_obj;
1231 struct __pyx_memoryview_obj;
1232 struct __pyx_memoryviewslice_obj;
1233 
1234 /* "_definitions/types.pxd":107
1235  * ctypedef unsigned int[:] MemoryViewLongIndexType
1236  * ELSE:
1237  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1238  *
1239  * # Used for indices of small matrices, or small size iterators
1240  */
1241 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1242 
1243 /* "_definitions/types.pxd":111
1244  * # Used for indices of small matrices, or small size iterators
1245  * ctypedef int IndexType
1246  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1247  *
1248  * # Used for both flags and integers used as signals, including negative integers
1249  */
1250 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1251 
1252 /* "_definitions/types.pxd":115
1253  * # Used for both flags and integers used as signals, including negative integers
1254  * ctypedef int FlagType
1255  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1256  *
1257  *
1258  */
1259 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1260 
1261 /* "_definitions/types.pxd":122
1262  * # ==============
1263  *
1264  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1265  * const double x,
1266  * const double kernel_param) nogil
1267  */
1268 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1269 
1270 /* "py_c_linear_operator.pxd":23
1271  * # ===================
1272  *
1273  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1274  *
1275  * # Attributes
1276  */
1277 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1278  PyObject_HEAD
1279  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1280  cLinearOperator<float> *Aop_float;
1281  cLinearOperator<double> *Aop_double;
1282  cLinearOperator<long double> *Aop_long_double;
1283  char *data_type_name;
1284  char *long_index_type_name;
1285  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1286  PyObject *parameters;
1287 };
1288 
1289 
1290 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1291  * # =========
1292  *
1293  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1294  * cdef A_csr
1295  * cdef A_indices_copy
1296  */
1297 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1298  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1299  PyObject *A_csr;
1300  PyObject *A_indices_copy;
1301  PyObject *A_index_pointer_copy;
1302 };
1303 
1304 
1305 /* "View.MemoryView":106
1306  *
1307  * @cname("__pyx_array")
1308  * cdef class array: # <<<<<<<<<<<<<<
1309  *
1310  * cdef:
1311  */
1312 struct __pyx_array_obj {
1313  PyObject_HEAD
1314  struct __pyx_vtabstruct_array *__pyx_vtab;
1315  char *data;
1316  Py_ssize_t len;
1317  char *format;
1318  int ndim;
1319  Py_ssize_t *_shape;
1320  Py_ssize_t *_strides;
1321  Py_ssize_t itemsize;
1322  PyObject *mode;
1323  PyObject *_format;
1324  void (*callback_free_data)(void *);
1325  int free_data;
1326  int dtype_is_object;
1327 };
1328 
1329 
1330 /* "View.MemoryView":280
1331  *
1332  * @cname('__pyx_MemviewEnum')
1333  * cdef class Enum(object): # <<<<<<<<<<<<<<
1334  * cdef object name
1335  * def __init__(self, name):
1336  */
1337 struct __pyx_MemviewEnum_obj {
1338  PyObject_HEAD
1339  PyObject *name;
1340 };
1341 
1342 
1343 /* "View.MemoryView":331
1344  *
1345  * @cname('__pyx_memoryview')
1346  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1347  *
1348  * cdef object obj
1349  */
1350 struct __pyx_memoryview_obj {
1351  PyObject_HEAD
1352  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1353  PyObject *obj;
1354  PyObject *_size;
1355  PyObject *_array_interface;
1356  PyThread_type_lock lock;
1357  __pyx_atomic_int acquisition_count[2];
1358  __pyx_atomic_int *acquisition_count_aligned_p;
1359  Py_buffer view;
1360  int flags;
1361  int dtype_is_object;
1362  __Pyx_TypeInfo *typeinfo;
1363 };
1364 
1365 
1366 /* "View.MemoryView":967
1367  *
1368  * @cname('__pyx_memoryviewslice')
1369  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1370  * "Internal class for passing memoryview slices to Python"
1371  *
1372  */
1373 struct __pyx_memoryviewslice_obj {
1374  struct __pyx_memoryview_obj __pyx_base;
1375  __Pyx_memviewslice from_slice;
1376  PyObject *from_object;
1377  PyObject *(*to_object_func)(char *);
1378  int (*to_dtype_func)(char *, PyObject *);
1379 };
1380 
1381 
1382 
1383 /* "py_c_linear_operator.pxd":23
1384  * # ===================
1385  *
1386  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1387  *
1388  * # Attributes
1389  */
1390 
1391 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1392  LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1393  LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1394  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1395  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1396  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1397  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1398  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1399 };
1400 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1401 
1402 
1403 /* "imate/_c_linear_operator/py_c_matrix.pyx":33
1404  * # =========
1405  *
1406  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1407  * """
1408  * Defines a linear operator that is a constant matrix.
1409  */
1410 
1411 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1412  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1413 };
1414 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1415 
1416 
1417 /* "View.MemoryView":106
1418  *
1419  * @cname("__pyx_array")
1420  * cdef class array: # <<<<<<<<<<<<<<
1421  *
1422  * cdef:
1423  */
1424 
1425 struct __pyx_vtabstruct_array {
1426  PyObject *(*get_memview)(struct __pyx_array_obj *);
1427 };
1428 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1429 
1430 
1431 /* "View.MemoryView":331
1432  *
1433  * @cname('__pyx_memoryview')
1434  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1435  *
1436  * cdef object obj
1437  */
1438 
1439 struct __pyx_vtabstruct_memoryview {
1440  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1441  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1442  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1443  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1444  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1445  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1446  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1447 };
1448 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1449 
1450 
1451 /* "View.MemoryView":967
1452  *
1453  * @cname('__pyx_memoryviewslice')
1454  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1455  * "Internal class for passing memoryview slices to Python"
1456  *
1457  */
1458 
1459 struct __pyx_vtabstruct__memoryviewslice {
1460  struct __pyx_vtabstruct_memoryview __pyx_base;
1461 };
1462 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1463 
1464 /* --- Runtime support code (head) --- */
1465 /* Refnanny.proto */
1466 #ifndef CYTHON_REFNANNY
1467  #define CYTHON_REFNANNY 0
1468 #endif
1469 #if CYTHON_REFNANNY
1470  typedef struct {
1471  void (*INCREF)(void*, PyObject*, int);
1472  void (*DECREF)(void*, PyObject*, int);
1473  void (*GOTREF)(void*, PyObject*, int);
1474  void (*GIVEREF)(void*, PyObject*, int);
1475  void* (*SetupContext)(const char*, int, const char*);
1476  void (*FinishContext)(void**);
1477  } __Pyx_RefNannyAPIStruct;
1478  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1479  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1480  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1481 #ifdef WITH_THREAD
1482  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1483  if (acquire_gil) {\
1484  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1485  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1486  PyGILState_Release(__pyx_gilstate_save);\
1487  } else {\
1488  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1489  }
1490 #else
1491  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1492  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1493 #endif
1494  #define __Pyx_RefNannyFinishContext()\
1495  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1496  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1497  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1498  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1499  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1500  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1501  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1502  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1503  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1504 #else
1505  #define __Pyx_RefNannyDeclarations
1506  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1507  #define __Pyx_RefNannyFinishContext()
1508  #define __Pyx_INCREF(r) Py_INCREF(r)
1509  #define __Pyx_DECREF(r) Py_DECREF(r)
1510  #define __Pyx_GOTREF(r)
1511  #define __Pyx_GIVEREF(r)
1512  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1513  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1514  #define __Pyx_XGOTREF(r)
1515  #define __Pyx_XGIVEREF(r)
1516 #endif
1517 #define __Pyx_XDECREF_SET(r, v) do {\
1518  PyObject *tmp = (PyObject *) r;\
1519  r = v; __Pyx_XDECREF(tmp);\
1520  } while (0)
1521 #define __Pyx_DECREF_SET(r, v) do {\
1522  PyObject *tmp = (PyObject *) r;\
1523  r = v; __Pyx_DECREF(tmp);\
1524  } while (0)
1525 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1526 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1527 
1528 /* PyObjectGetAttrStr.proto */
1529 #if CYTHON_USE_TYPE_SLOTS
1530 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1531 #else
1532 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1533 #endif
1534 
1535 /* GetBuiltinName.proto */
1536 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1537 
1538 /* RaiseDoubleKeywords.proto */
1539 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1540 
1541 /* ParseKeywords.proto */
1542 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1543  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1544  const char* function_name);
1545 
1546 /* RaiseArgTupleInvalid.proto */
1547 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1548  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1549 
1550 /* PyThreadStateGet.proto */
1551 #if CYTHON_FAST_THREAD_STATE
1552 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1553 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1554 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1555 #else
1556 #define __Pyx_PyThreadState_declare
1557 #define __Pyx_PyThreadState_assign
1558 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1559 #endif
1560 
1561 /* PyErrFetchRestore.proto */
1562 #if CYTHON_FAST_THREAD_STATE
1563 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1564 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1565 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1566 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1567 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1568 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1569 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1570 #if CYTHON_COMPILING_IN_CPYTHON
1571 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1572 #else
1573 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1574 #endif
1575 #else
1576 #define __Pyx_PyErr_Clear() PyErr_Clear()
1577 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1578 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1579 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1580 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1581 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1582 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1583 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1584 #endif
1585 
1586 /* Profile.proto */
1587 #ifndef CYTHON_PROFILE
1588 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1589  #define CYTHON_PROFILE 0
1590 #else
1591  #define CYTHON_PROFILE 1
1592 #endif
1593 #endif
1594 #ifndef CYTHON_TRACE_NOGIL
1595  #define CYTHON_TRACE_NOGIL 0
1596 #else
1597  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1598  #define CYTHON_TRACE 1
1599  #endif
1600 #endif
1601 #ifndef CYTHON_TRACE
1602  #define CYTHON_TRACE 0
1603 #endif
1604 #if CYTHON_TRACE
1605  #undef CYTHON_PROFILE_REUSE_FRAME
1606 #endif
1607 #ifndef CYTHON_PROFILE_REUSE_FRAME
1608  #define CYTHON_PROFILE_REUSE_FRAME 0
1609 #endif
1610 #if CYTHON_PROFILE || CYTHON_TRACE
1611  #include "compile.h"
1612  #include "frameobject.h"
1613  #include "traceback.h"
1614 #if PY_VERSION_HEX >= 0x030b00a6
1615  #ifndef Py_BUILD_CORE
1616  #define Py_BUILD_CORE 1
1617  #endif
1618  #include "internal/pycore_frame.h"
1619 #endif
1620  #if CYTHON_PROFILE_REUSE_FRAME
1621  #define CYTHON_FRAME_MODIFIER static
1622  #define CYTHON_FRAME_DEL(frame)
1623  #else
1624  #define CYTHON_FRAME_MODIFIER
1625  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1626  #endif
1627  #define __Pyx_TraceDeclarations\
1628  static PyCodeObject *__pyx_frame_code = NULL;\
1629  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1630  int __Pyx_use_tracing = 0;
1631  #define __Pyx_TraceFrameInit(codeobj)\
1632  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1633 #if PY_VERSION_HEX >= 0x030b00a2
1634  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1635  (unlikely((tstate)->cframe->use_tracing) &&\
1636  (!(check_tracing) || !(tstate)->tracing) &&\
1637  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1638  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1639  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1640 #elif PY_VERSION_HEX >= 0x030a00b1
1641  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1642  (unlikely((tstate)->cframe->use_tracing) &&\
1643  (!(check_tracing) || !(tstate)->tracing) &&\
1644  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1645  #define __Pyx_EnterTracing(tstate)\
1646  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1647  #define __Pyx_LeaveTracing(tstate)\
1648  do {\
1649  tstate->tracing--;\
1650  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1651  || tstate->c_profilefunc != NULL);\
1652  } while (0)
1653 #else
1654  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1655  (unlikely((tstate)->use_tracing) &&\
1656  (!(check_tracing) || !(tstate)->tracing) &&\
1657  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1658  #define __Pyx_EnterTracing(tstate)\
1659  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1660  #define __Pyx_LeaveTracing(tstate)\
1661  do {\
1662  tstate->tracing--;\
1663  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1664  || tstate->c_profilefunc != NULL);\
1665  } while (0)
1666 #endif
1667  #ifdef WITH_THREAD
1668  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1669  if (nogil) {\
1670  if (CYTHON_TRACE_NOGIL) {\
1671  PyThreadState *tstate;\
1672  PyGILState_STATE state = PyGILState_Ensure();\
1673  tstate = __Pyx_PyThreadState_Current;\
1674  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1675  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1676  }\
1677  PyGILState_Release(state);\
1678  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1679  }\
1680  } else {\
1681  PyThreadState* tstate = PyThreadState_GET();\
1682  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1683  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1684  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1685  }\
1686  }
1687  #else
1688  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1689  { PyThreadState* tstate = PyThreadState_GET();\
1690  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1691  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1692  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1693  }\
1694  }
1695  #endif
1696  #define __Pyx_TraceException()\
1697  if (likely(!__Pyx_use_tracing)); else {\
1698  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1699  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1700  __Pyx_EnterTracing(tstate);\
1701  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1702  if (exc_info) {\
1703  if (CYTHON_TRACE && tstate->c_tracefunc)\
1704  tstate->c_tracefunc(\
1705  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1706  tstate->c_profilefunc(\
1707  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1708  Py_DECREF(exc_info);\
1709  }\
1710  __Pyx_LeaveTracing(tstate);\
1711  }\
1712  }
1713  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1714  PyObject *type, *value, *traceback;
1715  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1716  __Pyx_EnterTracing(tstate);
1717  if (CYTHON_TRACE && tstate->c_tracefunc)
1718  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1719  if (tstate->c_profilefunc)
1720  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1721  CYTHON_FRAME_DEL(frame);
1722  __Pyx_LeaveTracing(tstate);
1723  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1724  }
1725  #ifdef WITH_THREAD
1726  #define __Pyx_TraceReturn(result, nogil)\
1727  if (likely(!__Pyx_use_tracing)); else {\
1728  if (nogil) {\
1729  if (CYTHON_TRACE_NOGIL) {\
1730  PyThreadState *tstate;\
1731  PyGILState_STATE state = PyGILState_Ensure();\
1732  tstate = __Pyx_PyThreadState_Current;\
1733  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1734  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1735  }\
1736  PyGILState_Release(state);\
1737  }\
1738  } else {\
1739  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1740  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1741  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1742  }\
1743  }\
1744  }
1745  #else
1746  #define __Pyx_TraceReturn(result, nogil)\
1747  if (likely(!__Pyx_use_tracing)); else {\
1748  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1749  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1750  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1751  }\
1752  }
1753  #endif
1754  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1755  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1756 #else
1757  #define __Pyx_TraceDeclarations
1758  #define __Pyx_TraceFrameInit(codeobj)
1759  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1760  #define __Pyx_TraceException()
1761  #define __Pyx_TraceReturn(result, nogil)
1762 #endif
1763 #if CYTHON_TRACE
1764  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1765  int ret;
1766  PyObject *type, *value, *traceback;
1767  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1768  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1769  __Pyx_EnterTracing(tstate);
1770  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1771  __Pyx_LeaveTracing(tstate);
1772  if (likely(!ret)) {
1773  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1774  } else {
1775  Py_XDECREF(type);
1776  Py_XDECREF(value);
1777  Py_XDECREF(traceback);
1778  }
1779  return ret;
1780  }
1781  #ifdef WITH_THREAD
1782  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1783  if (likely(!__Pyx_use_tracing)); else {\
1784  if (nogil) {\
1785  if (CYTHON_TRACE_NOGIL) {\
1786  int ret = 0;\
1787  PyThreadState *tstate;\
1788  PyGILState_STATE state = PyGILState_Ensure();\
1789  tstate = __Pyx_PyThreadState_Current;\
1790  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1791  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1792  }\
1793  PyGILState_Release(state);\
1794  if (unlikely(ret)) goto_error;\
1795  }\
1796  } else {\
1797  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1798  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1799  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1800  if (unlikely(ret)) goto_error;\
1801  }\
1802  }\
1803  }
1804  #else
1805  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1806  if (likely(!__Pyx_use_tracing)); else {\
1807  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1808  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1809  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1810  if (unlikely(ret)) goto_error;\
1811  }\
1812  }
1813  #endif
1814 #else
1815  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1816 #endif
1817 
1818 /* PyObjectCall.proto */
1819 #if CYTHON_COMPILING_IN_CPYTHON
1820 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1821 #else
1822 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1823 #endif
1824 
1825 /* RaiseException.proto */
1826 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1827 
1828 /* PyIntCompare.proto */
1829 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1830 
1831 /* IncludeStringH.proto */
1832 #include <string.h>
1833 
1834 /* BytesEquals.proto */
1835 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1836 
1837 /* PyDictVersioning.proto */
1838 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1839 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1840 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1841 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1842  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1843  (cache_var) = (value);
1844 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1845  static PY_UINT64_T __pyx_dict_version = 0;\
1846  static PyObject *__pyx_dict_cached_value = NULL;\
1847  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1848  (VAR) = __pyx_dict_cached_value;\
1849  } else {\
1850  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1851  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1852  }\
1853 }
1854 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1855 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1856 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1857 #else
1858 #define __PYX_GET_DICT_VERSION(dict) (0)
1859 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1860 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1861 #endif
1862 
1863 /* GetModuleGlobalName.proto */
1864 #if CYTHON_USE_DICT_VERSIONS
1865 #define __Pyx_GetModuleGlobalName(var, name) do {\
1866  static PY_UINT64_T __pyx_dict_version = 0;\
1867  static PyObject *__pyx_dict_cached_value = NULL;\
1868  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1869  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1870  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1871 } while(0)
1872 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1873  PY_UINT64_T __pyx_dict_version;\
1874  PyObject *__pyx_dict_cached_value;\
1875  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1876 } while(0)
1877 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1878 #else
1879 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1880 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1881 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1882 #endif
1883 
1884 /* PyCFunctionFastCall.proto */
1885 #if CYTHON_FAST_PYCCALL
1886 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1887 #else
1888 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1889 #endif
1890 
1891 /* PyFunctionFastCall.proto */
1892 #if CYTHON_FAST_PYCALL
1893 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1894  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1895 #if 1 || PY_VERSION_HEX < 0x030600B1
1896 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1897 #else
1898 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1899 #endif
1900 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1901  (sizeof(char [1 - 2*!(cond)]) - 1)
1902 #ifndef Py_MEMBER_SIZE
1903 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1904 #endif
1905 #if CYTHON_FAST_PYCALL
1906  static size_t __pyx_pyframe_localsplus_offset = 0;
1907  #include "frameobject.h"
1908 #if PY_VERSION_HEX >= 0x030b00a6
1909  #ifndef Py_BUILD_CORE
1910  #define Py_BUILD_CORE 1
1911  #endif
1912  #include "internal/pycore_frame.h"
1913 #endif
1914  #define __Pxy_PyFrame_Initialize_Offsets()\
1915  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1916  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1917  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1918  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1919 #endif // CYTHON_FAST_PYCALL
1920 #endif
1921 
1922 /* PyObjectCall2Args.proto */
1923 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1924 
1925 /* PyObjectCallMethO.proto */
1926 #if CYTHON_COMPILING_IN_CPYTHON
1927 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1928 #endif
1929 
1930 /* PyObjectCallOneArg.proto */
1931 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1932 
1933 /* PyObjectCallNoArg.proto */
1934 #if CYTHON_COMPILING_IN_CPYTHON
1935 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1936 #else
1937 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1938 #endif
1939 
1940 /* GetItemInt.proto */
1941 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1942  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1943  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1944  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1945  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1946 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1947  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1948  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1949  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1950 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1951  int wraparound, int boundscheck);
1952 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1953  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1954  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1955  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1956 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1957  int wraparound, int boundscheck);
1958 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1959 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1960  int is_list, int wraparound, int boundscheck);
1961 
1962 /* DictGetItem.proto */
1963 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1964 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1965 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1966  (likely(PyDict_CheckExact(obj)) ?\
1967  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1968 #else
1969 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1970 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1971 #endif
1972 
1973 /* MemviewSliceInit.proto */
1974 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1975 #define __Pyx_MEMVIEW_DIRECT 1
1976 #define __Pyx_MEMVIEW_PTR 2
1977 #define __Pyx_MEMVIEW_FULL 4
1978 #define __Pyx_MEMVIEW_CONTIG 8
1979 #define __Pyx_MEMVIEW_STRIDED 16
1980 #define __Pyx_MEMVIEW_FOLLOW 32
1981 #define __Pyx_IS_C_CONTIG 1
1982 #define __Pyx_IS_F_CONTIG 2
1983 static int __Pyx_init_memviewslice(
1984  struct __pyx_memoryview_obj *memview,
1985  int ndim,
1986  __Pyx_memviewslice *memviewslice,
1987  int memview_is_new_reference);
1988 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1989  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1990 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1991  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1992 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1993 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1994 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1995 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1996 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1997 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1998 
1999 /* ArgTypeTest.proto */
2000 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2001  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2002  __Pyx__ArgTypeTest(obj, type, name, exact))
2003 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2004 
2005 /* UnicodeEquals.proto */
2006 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2007 
2008 /* StrEquals.proto */
2009 #if PY_MAJOR_VERSION >= 3
2010 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2011 #else
2012 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2013 #endif
2014 
2015 /* UnaryNegOverflows.proto */
2016 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2017  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2018 
2019 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2020 /* WriteUnraisableException.proto */
2021 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2022  int lineno, const char *filename,
2023  int full_traceback, int nogil);
2024 
2025 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2026 /* GetAttr.proto */
2027 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2028 
2029 /* ObjectGetItem.proto */
2030 #if CYTHON_USE_TYPE_SLOTS
2031 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2032 #else
2033 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2034 #endif
2035 
2036 /* decode_c_string_utf16.proto */
2037 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2038  int byteorder = 0;
2039  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2040 }
2041 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2042  int byteorder = -1;
2043  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2044 }
2045 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2046  int byteorder = 1;
2047  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2048 }
2049 
2050 /* decode_c_string.proto */
2051 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2052  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2053  const char* encoding, const char* errors,
2054  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2055 
2056 /* PyErrExceptionMatches.proto */
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2059 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2060 #else
2061 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2062 #endif
2063 
2064 /* GetAttr3.proto */
2065 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2066 
2067 /* RaiseTooManyValuesToUnpack.proto */
2068 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2069 
2070 /* RaiseNeedMoreValuesToUnpack.proto */
2071 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2072 
2073 /* RaiseNoneIterError.proto */
2074 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2075 
2076 /* ExtTypeTest.proto */
2077 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2078 
2079 /* GetTopmostException.proto */
2080 #if CYTHON_USE_EXC_INFO_STACK
2081 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2082 #endif
2083 
2084 /* SaveResetException.proto */
2085 #if CYTHON_FAST_THREAD_STATE
2086 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2087 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2088 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2089 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2090 #else
2091 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2092 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2093 #endif
2094 
2095 /* GetException.proto */
2096 #if CYTHON_FAST_THREAD_STATE
2097 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2098 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2099 #else
2100 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2101 #endif
2102 
2103 /* SwapException.proto */
2104 #if CYTHON_FAST_THREAD_STATE
2105 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2106 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2107 #else
2108 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2109 #endif
2110 
2111 /* Import.proto */
2112 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2113 
2114 /* FastTypeChecks.proto */
2115 #if CYTHON_COMPILING_IN_CPYTHON
2116 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2117 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2118 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2119 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2120 #else
2121 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2122 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2123 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2124 #endif
2125 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2126 
2127 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2128 /* ListCompAppend.proto */
2129 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2130 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2131  PyListObject* L = (PyListObject*) list;
2132  Py_ssize_t len = Py_SIZE(list);
2133  if (likely(L->allocated > len)) {
2134  Py_INCREF(x);
2135  PyList_SET_ITEM(list, len, x);
2136  __Pyx_SET_SIZE(list, len + 1);
2137  return 0;
2138  }
2139  return PyList_Append(list, x);
2140 }
2141 #else
2142 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2143 #endif
2144 
2145 /* PyIntBinop.proto */
2146 #if !CYTHON_COMPILING_IN_PYPY
2147 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2148 #else
2149 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2150  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2151 #endif
2152 
2153 /* ListExtend.proto */
2154 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2155 #if CYTHON_COMPILING_IN_CPYTHON
2156  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2157  if (unlikely(!none))
2158  return -1;
2159  Py_DECREF(none);
2160  return 0;
2161 #else
2162  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2163 #endif
2164 }
2165 
2166 /* ListAppend.proto */
2167 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2168 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2169  PyListObject* L = (PyListObject*) list;
2170  Py_ssize_t len = Py_SIZE(list);
2171  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2172  Py_INCREF(x);
2173  PyList_SET_ITEM(list, len, x);
2174  __Pyx_SET_SIZE(list, len + 1);
2175  return 0;
2176  }
2177  return PyList_Append(list, x);
2178 }
2179 #else
2180 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2181 #endif
2182 
2183 /* AssertionsEnabled.proto */
2184 #define __Pyx_init_assertions_enabled()
2185 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2186  #define __pyx_assertions_enabled() (1)
2187 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2188  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2189 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2190  static int __pyx_assertions_enabled_flag;
2191  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2192  #undef __Pyx_init_assertions_enabled
2193  static void __Pyx_init_assertions_enabled(void) {
2194  __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2195  }
2196 #else
2197  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2198 #endif
2199 
2200 /* None.proto */
2201 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2202 
2203 /* PySequenceContains.proto */
2204 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2205  int result = PySequence_Contains(seq, item);
2206  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2207 }
2208 
2209 /* ImportFrom.proto */
2210 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2211 
2212 /* HasAttr.proto */
2213 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2214 
2215 /* CallNextTpDealloc.proto */
2216 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2217 
2218 /* CallNextTpTraverse.proto */
2219 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2220 
2221 /* CallNextTpClear.proto */
2222 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2223 
2224 /* PyObject_GenericGetAttrNoDict.proto */
2225 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2226 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2227 #else
2228 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2229 #endif
2230 
2231 /* PyObject_GenericGetAttr.proto */
2232 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2233 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2234 #else
2235 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2236 #endif
2237 
2238 /* TypeImport.proto */
2239 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2240 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2241 #if __STDC_VERSION__ >= 201112L
2242 #include <stdalign.h>
2243 #endif
2244 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2245 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2246 #else
2247 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2248 #endif
2249 enum __Pyx_ImportType_CheckSize_0_29_36 {
2250  __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2251  __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2252  __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2253 };
2254 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2255 #endif
2256 
2257 /* GetVTable.proto */
2258 static void* __Pyx_GetVtable(PyObject *dict);
2259 
2260 /* SetVTable.proto */
2261 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2262 
2263 /* PyObjectGetAttrStrNoError.proto */
2264 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2265 
2266 /* SetupReduce.proto */
2267 static int __Pyx_setup_reduce(PyObject* type_obj);
2268 
2269 /* FetchCommonType.proto */
2270 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2271 
2272 /* CythonFunctionShared.proto */
2273 #define __Pyx_CyFunction_USED 1
2274 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2275 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2276 #define __Pyx_CYFUNCTION_CCLASS 0x04
2277 #define __Pyx_CyFunction_GetClosure(f)\
2278  (((__pyx_CyFunctionObject *) (f))->func_closure)
2279 #define __Pyx_CyFunction_GetClassObj(f)\
2280  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2281 #define __Pyx_CyFunction_Defaults(type, f)\
2282  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2283 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2284  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2285 typedef struct {
2286  PyCFunctionObject func;
2287 #if PY_VERSION_HEX < 0x030500A0
2288  PyObject *func_weakreflist;
2289 #endif
2290  PyObject *func_dict;
2291  PyObject *func_name;
2292  PyObject *func_qualname;
2293  PyObject *func_doc;
2294  PyObject *func_globals;
2295  PyObject *func_code;
2296  PyObject *func_closure;
2297  PyObject *func_classobj;
2298  void *defaults;
2299  int defaults_pyobjects;
2300  size_t defaults_size; // used by FusedFunction for copying defaults
2301  int flags;
2302  PyObject *defaults_tuple;
2303  PyObject *defaults_kwdict;
2304  PyObject *(*defaults_getter)(PyObject *);
2305  PyObject *func_annotations;
2306 } __pyx_CyFunctionObject;
2307 static PyTypeObject *__pyx_CyFunctionType = 0;
2308 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2309 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2310  int flags, PyObject* qualname,
2311  PyObject *self,
2312  PyObject *module, PyObject *globals,
2313  PyObject* code);
2314 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2315  size_t size,
2316  int pyobjects);
2317 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2318  PyObject *tuple);
2319 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2320  PyObject *dict);
2321 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2322  PyObject *dict);
2323 static int __pyx_CyFunction_init(void);
2324 
2325 /* CythonFunction.proto */
2326 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2327  int flags, PyObject* qualname,
2328  PyObject *closure,
2329  PyObject *module, PyObject *globals,
2330  PyObject* code);
2331 
2332 /* CLineInTraceback.proto */
2333 #ifdef CYTHON_CLINE_IN_TRACEBACK
2334 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2335 #else
2336 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2337 #endif
2338 
2339 /* CodeObjectCache.proto */
2340 typedef struct {
2341  PyCodeObject* code_object;
2342  int code_line;
2343 } __Pyx_CodeObjectCacheEntry;
2344 struct __Pyx_CodeObjectCache {
2345  int count;
2346  int max_count;
2347  __Pyx_CodeObjectCacheEntry* entries;
2348 };
2349 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2350 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2351 static PyCodeObject *__pyx_find_code_object(int code_line);
2352 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2353 
2354 /* AddTraceback.proto */
2355 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2356  int py_line, const char *filename);
2357 
2358 #if PY_MAJOR_VERSION < 3
2359  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2360  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2361 #else
2362  #define __Pyx_GetBuffer PyObject_GetBuffer
2363  #define __Pyx_ReleaseBuffer PyBuffer_Release
2364 #endif
2365 
2366 
2367 /* BufferStructDeclare.proto */
2368 typedef struct {
2369  Py_ssize_t shape, strides, suboffsets;
2370 } __Pyx_Buf_DimInfo;
2371 typedef struct {
2372  size_t refcount;
2373  Py_buffer pybuffer;
2374 } __Pyx_Buffer;
2375 typedef struct {
2376  __Pyx_Buffer *rcbuffer;
2377  char *data;
2378  __Pyx_Buf_DimInfo diminfo[8];
2379 } __Pyx_LocalBuf_ND;
2380 
2381 /* MemviewSliceIsContig.proto */
2382 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2383 
2384 /* OverlappingSlices.proto */
2385 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2386  __Pyx_memviewslice *slice2,
2387  int ndim, size_t itemsize);
2388 
2389 /* Capsule.proto */
2390 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2391 
2392 /* GCCDiagnostics.proto */
2393 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2394 #define __Pyx_HAS_GCC_DIAGNOSTIC
2395 #endif
2396 
2397 /* IsLittleEndian.proto */
2398 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2399 
2400 /* BufferFormatCheck.proto */
2401 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2402 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2403  __Pyx_BufFmt_StackElem* stack,
2404  __Pyx_TypeInfo* type);
2405 
2406 /* TypeInfoCompare.proto */
2407 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2408 
2409 /* MemviewSliceValidateAndInit.proto */
2410 static int __Pyx_ValidateAndInit_memviewslice(
2411  int *axes_specs,
2412  int c_or_f_flag,
2413  int buf_flags,
2414  int ndim,
2415  __Pyx_TypeInfo *dtype,
2416  __Pyx_BufFmt_StackElem stack[],
2417  __Pyx_memviewslice *memviewslice,
2418  PyObject *original_obj);
2419 
2420 /* ObjectToMemviewSlice.proto */
2421 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2422 
2423 /* ObjectToMemviewSlice.proto */
2424 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *, int writable_flag);
2425 
2426 /* CppExceptionConversion.proto */
2427 #ifndef __Pyx_CppExn2PyErr
2428 #include <new>
2429 #include <typeinfo>
2430 #include <stdexcept>
2431 #include <ios>
2432 static void __Pyx_CppExn2PyErr() {
2433  try {
2434  if (PyErr_Occurred())
2435  ; // let the latest Python exn pass through and ignore the current one
2436  else
2437  throw;
2438  } catch (const std::bad_alloc& exn) {
2439  PyErr_SetString(PyExc_MemoryError, exn.what());
2440  } catch (const std::bad_cast& exn) {
2441  PyErr_SetString(PyExc_TypeError, exn.what());
2442  } catch (const std::bad_typeid& exn) {
2443  PyErr_SetString(PyExc_TypeError, exn.what());
2444  } catch (const std::domain_error& exn) {
2445  PyErr_SetString(PyExc_ValueError, exn.what());
2446  } catch (const std::invalid_argument& exn) {
2447  PyErr_SetString(PyExc_ValueError, exn.what());
2448  } catch (const std::ios_base::failure& exn) {
2449  PyErr_SetString(PyExc_IOError, exn.what());
2450  } catch (const std::out_of_range& exn) {
2451  PyErr_SetString(PyExc_IndexError, exn.what());
2452  } catch (const std::overflow_error& exn) {
2453  PyErr_SetString(PyExc_OverflowError, exn.what());
2454  } catch (const std::range_error& exn) {
2455  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2456  } catch (const std::underflow_error& exn) {
2457  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2458  } catch (const std::exception& exn) {
2459  PyErr_SetString(PyExc_RuntimeError, exn.what());
2460  }
2461  catch (...)
2462  {
2463  PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
2464  }
2465 }
2466 #endif
2467 
2468 /* ObjectToMemviewSlice.proto */
2469 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2470 
2471 /* ObjectToMemviewSlice.proto */
2472 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
2473 
2474 /* ObjectToMemviewSlice.proto */
2475 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2476 
2477 /* ObjectToMemviewSlice.proto */
2478 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *, int writable_flag);
2479 
2480 /* ObjectToMemviewSlice.proto */
2481 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2482 
2483 /* ObjectToMemviewSlice.proto */
2484 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2485 
2486 /* ObjectToMemviewSlice.proto */
2487 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2488 
2489 /* ObjectToMemviewSlice.proto */
2490 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2491 
2492 /* MemviewSliceCopyTemplate.proto */
2493 static __Pyx_memviewslice
2494 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2495  const char *mode, int ndim,
2496  size_t sizeof_dtype, int contig_flag,
2497  int dtype_is_object);
2498 
2499 /* CIntToPy.proto */
2500 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2501 
2502 /* CIntFromPy.proto */
2503 static CYTHON_INLINE LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *);
2504 
2505 /* CIntFromPy.proto */
2506 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2507 
2508 /* CIntFromPy.proto */
2509 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2510 
2511 /* CIntToPy.proto */
2512 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2513 
2514 /* CIntFromPy.proto */
2515 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2516 
2517 /* CheckBinaryVersion.proto */
2518 static int __Pyx_check_binary_version(void);
2519 
2520 /* InitStrings.proto */
2521 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2522 
2523 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2524 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2525 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2526 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2527 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2528 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2529 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2530 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2531 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2532 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2533 
2534 /* Module declarations from 'imate._definitions.types' */
2535 
2536 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2537 
2538 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2539 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2540 
2541 /* Module declarations from 'imate._c_linear_operator.c_matrix' */
2542 
2543 /* Module declarations from 'imate._c_linear_operator.c_dense_matrix' */
2544 
2545 /* Module declarations from 'imate._c_linear_operator.c_csr_matrix' */
2546 
2547 /* Module declarations from 'imate._c_linear_operator.c_csc_matrix' */
2548 
2549 /* Module declarations from 'imate._c_linear_operator.py_c_matrix' */
2550 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2551 static PyTypeObject *__pyx_array_type = 0;
2552 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2553 static PyTypeObject *__pyx_memoryview_type = 0;
2554 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2555 static PyObject *generic = 0;
2556 static PyObject *strided = 0;
2557 static PyObject *indirect = 0;
2558 static PyObject *contiguous = 0;
2559 static PyObject *indirect_contiguous = 0;
2560 static int __pyx_memoryview_thread_locks_used;
2561 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2562 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2563 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2564 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2565 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2566 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2567 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2568 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2569 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2570 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2571 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2572 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2573 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2574 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2575 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2576 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2577 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2578 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2579 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2580 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2581 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2582 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2583 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2584 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2585 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2586 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2587 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2588 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2589 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2590 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2591 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2592 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2593 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2594 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2595 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2596 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2597 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2598 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2599 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_matrix"
2600 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix;
2601 int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix = 0;
2602 
2603 /* Implementation of 'imate._c_linear_operator.py_c_matrix' */
2604 static PyObject *__pyx_builtin_ValueError;
2605 static PyObject *__pyx_builtin_TypeError;
2606 static PyObject *__pyx_builtin_MemoryError;
2607 static PyObject *__pyx_builtin_enumerate;
2608 static PyObject *__pyx_builtin_range;
2609 static PyObject *__pyx_builtin_Ellipsis;
2610 static PyObject *__pyx_builtin_id;
2611 static PyObject *__pyx_builtin_IndexError;
2612 static const char __pyx_k_A[] = "A";
2613 static const char __pyx_k_O[] = "O";
2614 static const char __pyx_k_c[] = "c";
2615 static const char __pyx_k_id[] = "id";
2616 static const char __pyx_k_new[] = "__new__";
2617 static const char __pyx_k_obj[] = "obj";
2618 static const char __pyx_k_base[] = "base";
2619 static const char __pyx_k_copy[] = "copy";
2620 static const char __pyx_k_data[] = "data";
2621 static const char __pyx_k_dict[] = "__dict__";
2622 static const char __pyx_k_main[] = "__main__";
2623 static const char __pyx_k_mode[] = "mode";
2624 static const char __pyx_k_name[] = "name";
2625 static const char __pyx_k_ndim[] = "ndim";
2626 static const char __pyx_k_pack[] = "pack";
2627 static const char __pyx_k_self[] = "self";
2628 static const char __pyx_k_size[] = "size";
2629 static const char __pyx_k_step[] = "step";
2630 static const char __pyx_k_stop[] = "stop";
2631 static const char __pyx_k_test[] = "__test__";
2632 static const char __pyx_k_ASCII[] = "ASCII";
2633 static const char __pyx_k_class[] = "__class__";
2634 static const char __pyx_k_dtype[] = "dtype";
2635 static const char __pyx_k_error[] = "error";
2636 static const char __pyx_k_flags[] = "flags";
2637 static const char __pyx_k_numpy[] = "numpy";
2638 static const char __pyx_k_range[] = "range";
2639 static const char __pyx_k_shape[] = "shape";
2640 static const char __pyx_k_start[] = "start";
2641 static const char __pyx_k_astype[] = "astype";
2642 static const char __pyx_k_encode[] = "encode";
2643 static const char __pyx_k_format[] = "format";
2644 static const char __pyx_k_import[] = "__import__";
2645 static const char __pyx_k_indptr[] = "indptr";
2646 static const char __pyx_k_name_2[] = "__name__";
2647 static const char __pyx_k_pickle[] = "pickle";
2648 static const char __pyx_k_reduce[] = "__reduce__";
2649 static const char __pyx_k_struct[] = "struct";
2650 static const char __pyx_k_unpack[] = "unpack";
2651 static const char __pyx_k_update[] = "update";
2652 static const char __pyx_k_float32[] = "float32";
2653 static const char __pyx_k_float64[] = "float64";
2654 static const char __pyx_k_fortran[] = "fortran";
2655 static const char __pyx_k_indices[] = "indices";
2656 static const char __pyx_k_memview[] = "memview";
2657 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2658 static const char __pyx_k_float128[] = "float128";
2659 static const char __pyx_k_getstate[] = "__getstate__";
2660 static const char __pyx_k_issparse[] = "issparse";
2661 static const char __pyx_k_itemsize[] = "itemsize";
2662 static const char __pyx_k_pyx_type[] = "__pyx_type";
2663 static const char __pyx_k_setstate[] = "__setstate__";
2664 static const char __pyx_k_A_indices[] = "A_indices";
2665 static const char __pyx_k_TypeError[] = "TypeError";
2666 static const char __pyx_k_enumerate[] = "enumerate";
2667 static const char __pyx_k_pycMatrix[] = "pycMatrix";
2668 static const char __pyx_k_pyx_state[] = "__pyx_state";
2669 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2670 static const char __pyx_k_A_num_rows[] = "A_num_rows";
2671 static const char __pyx_k_IndexError[] = "IndexError";
2672 static const char __pyx_k_ValueError[] = "ValueError";
2673 static const char __pyx_k_csr_matrix[] = "csr_matrix";
2674 static const char __pyx_k_pyx_result[] = "__pyx_result";
2675 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2676 static const char __pyx_k_MemoryError[] = "MemoryError";
2677 static const char __pyx_k_PickleError[] = "PickleError";
2678 static const char __pyx_k_A_data_float[] = "A_data_float";
2679 static const char __pyx_k_A_indices_mv[] = "A_indices_mv";
2680 static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
2681 static const char __pyx_k_F_CONTIGUOUS[] = "F_CONTIGUOUS";
2682 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2683 static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
2684 static const char __pyx_k_sort_indices[] = "sort_indices";
2685 static const char __pyx_k_stringsource[] = "stringsource";
2686 static const char __pyx_k_A_data_double[] = "A_data_double";
2687 static const char __pyx_k_A_num_columns[] = "A_num_columns";
2688 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2689 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2690 static const char __pyx_k_A_is_row_major[] = "A_is_row_major";
2691 static const char __pyx_k_isspmatrix_csc[] = "isspmatrix_csc";
2692 static const char __pyx_k_isspmatrix_csr[] = "isspmatrix_csr";
2693 static const char __pyx_k_A_data_float_mv[] = "A_data_float_mv";
2694 static const char __pyx_k_A_index_pointer[] = "A_index_pointer";
2695 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2696 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2697 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2698 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2699 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2700 static const char __pyx_k_A_cannot_be_None[] = "A cannot be None.";
2701 static const char __pyx_k_A_data_double_mv[] = "A_data_double_mv";
2702 static const char __pyx_k_A_data_float_mv_c[] = "A_data_float_mv_c";
2703 static const char __pyx_k_A_data_float_mv_f[] = "A_data_float_mv_f";
2704 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2705 static const char __pyx_k_A_data_double_mv_c[] = "A_data_double_mv_c";
2706 static const char __pyx_k_A_data_double_mv_f[] = "A_data_double_mv_f";
2707 static const char __pyx_k_A_data_long_double[] = "A_data_long_double";
2708 static const char __pyx_k_A_index_pointer_mv[] = "A_index_pointer_mv";
2709 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2710 static const char __pyx_k_has_sorted_indices[] = "has_sorted_indices";
2711 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2712 static const char __pyx_k_set_csc_matrix_float[] = "set_csc_matrix_float";
2713 static const char __pyx_k_set_csr_matrix_float[] = "set_csr_matrix_float";
2714 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2715 static const char __pyx_k_A_data_long_double_mv[] = "A_data_long_double_mv";
2716 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2717 static const char __pyx_k_set_csc_matrix_double[] = "set_csc_matrix_double";
2718 static const char __pyx_k_set_csr_matrix_double[] = "set_csr_matrix_double";
2719 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2720 static const char __pyx_k_set_dense_matrix_float[] = "set_dense_matrix_float";
2721 static const char __pyx_k_A_data_long_double_mv_c[] = "A_data_long_double_mv_c";
2722 static const char __pyx_k_A_data_long_double_mv_f[] = "A_data_long_double_mv_f";
2723 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2724 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2725 static const char __pyx_k_set_dense_matrix_double[] = "set_dense_matrix_double";
2726 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2727 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2728 static const char __pyx_k_pycMatrix___reduce_cython[] = "pycMatrix.__reduce_cython__";
2729 static const char __pyx_k_set_csc_matrix_long_double[] = "set_csc_matrix_long_double";
2730 static const char __pyx_k_set_csr_matrix_long_double[] = "set_csr_matrix_long_double";
2731 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2732 static const char __pyx_k_pycMatrix___setstate_cython[] = "pycMatrix.__setstate_cython__";
2733 static const char __pyx_k_set_dense_matrix_long_double[] = "set_dense_matrix_long_double";
2734 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2735 static const char __pyx_k_pycMatrix_set_csc_matrix_float[] = "pycMatrix.set_csc_matrix_float";
2736 static const char __pyx_k_pycMatrix_set_csr_matrix_float[] = "pycMatrix.set_csr_matrix_float";
2737 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2738 static const char __pyx_k_pycMatrix_set_csc_matrix_double[] = "pycMatrix.set_csc_matrix_double";
2739 static const char __pyx_k_pycMatrix_set_csr_matrix_double[] = "pycMatrix.set_csr_matrix_double";
2740 static const char __pyx_k_pycMatrix_set_dense_matrix_long[] = "pycMatrix.set_dense_matrix_long_double";
2741 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2742 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2743 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2744 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2745 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be \"float32\", \"float64\", or \"float128\".";
2746 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2747 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2748 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2749 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] = "Input matrix should be a 2-dimensional array.";
2750 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2751 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] = "Matrix A should be either C or F contiguous.";
2752 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2753 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2754 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2755 static const char __pyx_k_imate__c_linear_operator_py_c_ma[] = "imate/_c_linear_operator/py_c_matrix.pyx";
2756 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2757 static const char __pyx_k_pycMatrix_set_csc_matrix_long_do[] = "pycMatrix.set_csc_matrix_long_double";
2758 static const char __pyx_k_pycMatrix_set_csr_matrix_long_do[] = "pycMatrix.set_csr_matrix_long_double";
2759 static const char __pyx_k_pycMatrix_set_dense_matrix_doubl[] = "pycMatrix.set_dense_matrix_double";
2760 static const char __pyx_k_pycMatrix_set_dense_matrix_float[] = "pycMatrix.set_dense_matrix_float";
2761 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2762 static const char __pyx_k_imate__c_linear_operator_py_c_ma_2[] = "imate._c_linear_operator.py_c_matrix";
2763 static PyObject *__pyx_n_s_A;
2764 static PyObject *__pyx_n_s_ASCII;
2765 static PyObject *__pyx_kp_u_A_cannot_be_None;
2766 static PyObject *__pyx_n_s_A_data_double;
2767 static PyObject *__pyx_n_s_A_data_double_mv;
2768 static PyObject *__pyx_n_s_A_data_double_mv_c;
2769 static PyObject *__pyx_n_s_A_data_double_mv_f;
2770 static PyObject *__pyx_n_s_A_data_float;
2771 static PyObject *__pyx_n_s_A_data_float_mv;
2772 static PyObject *__pyx_n_s_A_data_float_mv_c;
2773 static PyObject *__pyx_n_s_A_data_float_mv_f;
2774 static PyObject *__pyx_n_s_A_data_long_double;
2775 static PyObject *__pyx_n_s_A_data_long_double_mv;
2776 static PyObject *__pyx_n_s_A_data_long_double_mv_c;
2777 static PyObject *__pyx_n_s_A_data_long_double_mv_f;
2778 static PyObject *__pyx_n_s_A_index_pointer;
2779 static PyObject *__pyx_n_s_A_index_pointer_mv;
2780 static PyObject *__pyx_n_s_A_indices;
2781 static PyObject *__pyx_n_s_A_indices_mv;
2782 static PyObject *__pyx_n_s_A_is_row_major;
2783 static PyObject *__pyx_n_s_A_num_columns;
2784 static PyObject *__pyx_n_s_A_num_rows;
2785 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2786 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2787 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2788 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2789 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2790 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2791 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2792 static PyObject *__pyx_n_s_Ellipsis;
2793 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2794 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2795 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2796 static PyObject *__pyx_n_s_IndexError;
2797 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2798 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2799 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2800 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2801 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2802 static PyObject *__pyx_n_s_MemoryError;
2803 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2804 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2805 static PyObject *__pyx_n_b_O;
2806 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2807 static PyObject *__pyx_n_s_PickleError;
2808 static PyObject *__pyx_n_s_TypeError;
2809 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2810 static PyObject *__pyx_n_s_ValueError;
2811 static PyObject *__pyx_n_s_View_MemoryView;
2812 static PyObject *__pyx_n_s_allocate_buffer;
2813 static PyObject *__pyx_n_s_astype;
2814 static PyObject *__pyx_n_s_base;
2815 static PyObject *__pyx_n_s_c;
2816 static PyObject *__pyx_n_u_c;
2817 static PyObject *__pyx_n_s_class;
2818 static PyObject *__pyx_n_s_cline_in_traceback;
2819 static PyObject *__pyx_kp_s_contiguous_and_direct;
2820 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2821 static PyObject *__pyx_n_s_copy;
2822 static PyObject *__pyx_n_s_csr_matrix;
2823 static PyObject *__pyx_n_s_data;
2824 static PyObject *__pyx_n_s_dict;
2825 static PyObject *__pyx_n_s_dtype;
2826 static PyObject *__pyx_n_s_dtype_is_object;
2827 static PyObject *__pyx_n_s_encode;
2828 static PyObject *__pyx_n_s_enumerate;
2829 static PyObject *__pyx_n_s_error;
2830 static PyObject *__pyx_n_s_flags;
2831 static PyObject *__pyx_n_b_float128;
2832 static PyObject *__pyx_n_b_float32;
2833 static PyObject *__pyx_n_b_float64;
2834 static PyObject *__pyx_n_s_format;
2835 static PyObject *__pyx_n_s_fortran;
2836 static PyObject *__pyx_n_u_fortran;
2837 static PyObject *__pyx_n_s_getstate;
2838 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2839 static PyObject *__pyx_n_s_has_sorted_indices;
2840 static PyObject *__pyx_n_s_id;
2841 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_ma;
2842 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_ma_2;
2843 static PyObject *__pyx_n_s_import;
2844 static PyObject *__pyx_n_s_indices;
2845 static PyObject *__pyx_n_s_indptr;
2846 static PyObject *__pyx_n_s_issparse;
2847 static PyObject *__pyx_n_s_isspmatrix_csc;
2848 static PyObject *__pyx_n_s_isspmatrix_csr;
2849 static PyObject *__pyx_n_s_itemsize;
2850 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2851 static PyObject *__pyx_n_s_main;
2852 static PyObject *__pyx_n_s_memview;
2853 static PyObject *__pyx_n_s_mode;
2854 static PyObject *__pyx_n_s_name;
2855 static PyObject *__pyx_n_s_name_2;
2856 static PyObject *__pyx_n_s_ndim;
2857 static PyObject *__pyx_n_s_new;
2858 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2859 static PyObject *__pyx_n_s_numpy;
2860 static PyObject *__pyx_n_s_obj;
2861 static PyObject *__pyx_n_s_pack;
2862 static PyObject *__pyx_n_s_pickle;
2863 static PyObject *__pyx_n_s_pycMatrix;
2864 static PyObject *__pyx_n_s_pycMatrix___reduce_cython;
2865 static PyObject *__pyx_n_s_pycMatrix___setstate_cython;
2866 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_double;
2867 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_float;
2868 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_long_do;
2869 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_double;
2870 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_float;
2871 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_long_do;
2872 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_doubl;
2873 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_float;
2874 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_long;
2875 static PyObject *__pyx_n_s_pyx_PickleError;
2876 static PyObject *__pyx_n_s_pyx_checksum;
2877 static PyObject *__pyx_n_s_pyx_getbuffer;
2878 static PyObject *__pyx_n_s_pyx_result;
2879 static PyObject *__pyx_n_s_pyx_state;
2880 static PyObject *__pyx_n_s_pyx_type;
2881 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2882 static PyObject *__pyx_n_s_pyx_vtable;
2883 static PyObject *__pyx_n_s_range;
2884 static PyObject *__pyx_n_s_reduce;
2885 static PyObject *__pyx_n_s_reduce_cython;
2886 static PyObject *__pyx_n_s_reduce_ex;
2887 static PyObject *__pyx_n_s_scipy_sparse;
2888 static PyObject *__pyx_n_s_self;
2889 static PyObject *__pyx_n_s_set_csc_matrix_double;
2890 static PyObject *__pyx_n_s_set_csc_matrix_float;
2891 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2892 static PyObject *__pyx_n_s_set_csr_matrix_double;
2893 static PyObject *__pyx_n_s_set_csr_matrix_float;
2894 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2895 static PyObject *__pyx_n_s_set_dense_matrix_double;
2896 static PyObject *__pyx_n_s_set_dense_matrix_float;
2897 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2898 static PyObject *__pyx_n_s_setstate;
2899 static PyObject *__pyx_n_s_setstate_cython;
2900 static PyObject *__pyx_n_s_shape;
2901 static PyObject *__pyx_n_s_size;
2902 static PyObject *__pyx_n_s_sort_indices;
2903 static PyObject *__pyx_n_s_start;
2904 static PyObject *__pyx_n_s_step;
2905 static PyObject *__pyx_n_s_stop;
2906 static PyObject *__pyx_kp_s_strided_and_direct;
2907 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2908 static PyObject *__pyx_kp_s_strided_and_indirect;
2909 static PyObject *__pyx_kp_s_stringsource;
2910 static PyObject *__pyx_n_s_struct;
2911 static PyObject *__pyx_n_s_test;
2912 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2913 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2914 static PyObject *__pyx_n_s_unpack;
2915 static PyObject *__pyx_n_s_update;
2916 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2917 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2918 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2919 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2920 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2921 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2922 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2923 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2924 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2925 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2926 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self); /* proto */
2927 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2928 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2929 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2930 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2932 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2933 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2934 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2935 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2936 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2937 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2938 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2939 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2940 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2941 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2942 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2943 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2945 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2946 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2947 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2948 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2949 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2950 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2951 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2952 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2953 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2954 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2955 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2956 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2957 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2958 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2959 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2960 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2961 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2962 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2963 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2964 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2965 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2966 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2967 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2968 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2969 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2970 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2971 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2972 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2973 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2974 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2975 static PyObject *__pyx_int_0;
2976 static PyObject *__pyx_int_1;
2977 static PyObject *__pyx_int_2;
2978 static PyObject *__pyx_int_112105877;
2979 static PyObject *__pyx_int_136983863;
2980 static PyObject *__pyx_int_184977713;
2981 static PyObject *__pyx_int_neg_1;
2982 static PyObject *__pyx_tuple_;
2983 static PyObject *__pyx_tuple__2;
2984 static PyObject *__pyx_tuple__3;
2985 static PyObject *__pyx_tuple__5;
2986 static PyObject *__pyx_slice__32;
2987 static PyObject *__pyx_tuple__15;
2988 static PyObject *__pyx_tuple__17;
2989 static PyObject *__pyx_tuple__18;
2990 static PyObject *__pyx_tuple__19;
2991 static PyObject *__pyx_tuple__20;
2992 static PyObject *__pyx_tuple__21;
2993 static PyObject *__pyx_tuple__22;
2994 static PyObject *__pyx_tuple__23;
2995 static PyObject *__pyx_tuple__24;
2996 static PyObject *__pyx_tuple__25;
2997 static PyObject *__pyx_tuple__26;
2998 static PyObject *__pyx_tuple__27;
2999 static PyObject *__pyx_tuple__28;
3000 static PyObject *__pyx_tuple__29;
3001 static PyObject *__pyx_tuple__30;
3002 static PyObject *__pyx_tuple__31;
3003 static PyObject *__pyx_tuple__33;
3004 static PyObject *__pyx_tuple__34;
3005 static PyObject *__pyx_tuple__35;
3006 static PyObject *__pyx_tuple__37;
3007 static PyObject *__pyx_tuple__38;
3008 static PyObject *__pyx_tuple__39;
3009 static PyObject *__pyx_tuple__40;
3010 static PyObject *__pyx_tuple__41;
3011 static PyObject *__pyx_tuple__42;
3012 static PyObject *__pyx_tuple__43;
3013 static PyObject *__pyx_tuple__44;
3014 static PyObject *__pyx_tuple__45;
3015 static PyObject *__pyx_tuple__46;
3016 static PyObject *__pyx_tuple__47;
3017 static PyObject *__pyx_tuple__48;
3018 static PyObject *__pyx_tuple__49;
3019 static PyObject *__pyx_tuple__50;
3020 static PyObject *__pyx_tuple__51;
3021 static PyObject *__pyx_tuple__52;
3022 static PyObject *__pyx_tuple__53;
3023 static PyObject *__pyx_tuple__54;
3024 static PyObject *__pyx_codeobj__4;
3025 static PyObject *__pyx_codeobj__6;
3026 static PyObject *__pyx_codeobj__7;
3027 static PyObject *__pyx_codeobj__8;
3028 static PyObject *__pyx_codeobj__9;
3029 static PyObject *__pyx_codeobj__10;
3030 static PyObject *__pyx_codeobj__11;
3031 static PyObject *__pyx_codeobj__12;
3032 static PyObject *__pyx_codeobj__13;
3033 static PyObject *__pyx_codeobj__14;
3034 static PyObject *__pyx_codeobj__16;
3035 static PyObject *__pyx_codeobj__36;
3036 /* Late includes */
3037 
3038 /* "imate/_c_linear_operator/py_c_matrix.pyx":119
3039  * # =========
3040  *
3041  * def __cinit__(self, A): # <<<<<<<<<<<<<<
3042  * """
3043  * Sets the matrix A.
3044  */
3045 
3046 /* Python wrapper */
3047 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3048 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3049  PyObject *__pyx_v_A = 0;
3050  int __pyx_lineno = 0;
3051  const char *__pyx_filename = NULL;
3052  int __pyx_clineno = 0;
3053  int __pyx_r;
3054  __Pyx_RefNannyDeclarations
3055  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3056  {
3057  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,0};
3058  PyObject* values[1] = {0};
3059  if (unlikely(__pyx_kwds)) {
3060  Py_ssize_t kw_args;
3061  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3062  switch (pos_args) {
3063  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3064  CYTHON_FALLTHROUGH;
3065  case 0: break;
3066  default: goto __pyx_L5_argtuple_error;
3067  }
3068  kw_args = PyDict_Size(__pyx_kwds);
3069  switch (pos_args) {
3070  case 0:
3071  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3072  else goto __pyx_L5_argtuple_error;
3073  }
3074  if (unlikely(kw_args > 0)) {
3075  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
3076  }
3077  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3078  goto __pyx_L5_argtuple_error;
3079  } else {
3080  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3081  }
3082  __pyx_v_A = values[0];
3083  }
3084  goto __pyx_L4_argument_unpacking_done;
3085  __pyx_L5_argtuple_error:;
3086  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
3087  __pyx_L3_error:;
3088  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3089  __Pyx_RefNannyFinishContext();
3090  return -1;
3091  __pyx_L4_argument_unpacking_done:;
3092  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), __pyx_v_A);
3093 
3094  /* function exit code */
3095  __Pyx_RefNannyFinishContext();
3096  return __pyx_r;
3097 }
3098 
3099 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
3100  int __pyx_r;
3101  __Pyx_TraceDeclarations
3102  __Pyx_RefNannyDeclarations
3103  int __pyx_t_1;
3104  int __pyx_t_2;
3105  PyObject *__pyx_t_3 = NULL;
3106  PyObject *__pyx_t_4 = NULL;
3107  PyObject *__pyx_t_5 = NULL;
3108  int __pyx_lineno = 0;
3109  const char *__pyx_filename = NULL;
3110  int __pyx_clineno = 0;
3111  __Pyx_RefNannySetupContext("__cinit__", 0);
3112  __Pyx_TraceCall("__cinit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
3113 
3114  /* "imate/_c_linear_operator/py_c_matrix.pyx":125
3115  *
3116  * # Check A
3117  * if A is None: # <<<<<<<<<<<<<<
3118  * raise ValueError('A cannot be None.')
3119  *
3120  */
3121  __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3122  __pyx_t_1 = (__pyx_v_A == Py_None);
3123  __pyx_t_2 = (__pyx_t_1 != 0);
3124  if (unlikely(__pyx_t_2)) {
3125 
3126  /* "imate/_c_linear_operator/py_c_matrix.pyx":126
3127  * # Check A
3128  * if A is None:
3129  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
3130  *
3131  * if A.ndim != 2:
3132  */
3133  __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
3134  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
3135  __Pyx_GOTREF(__pyx_t_3);
3136  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3137  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3138  __PYX_ERR(0, 126, __pyx_L1_error)
3139 
3140  /* "imate/_c_linear_operator/py_c_matrix.pyx":125
3141  *
3142  * # Check A
3143  * if A is None: # <<<<<<<<<<<<<<
3144  * raise ValueError('A cannot be None.')
3145  *
3146  */
3147  }
3148 
3149  /* "imate/_c_linear_operator/py_c_matrix.pyx":128
3150  * raise ValueError('A cannot be None.')
3151  *
3152  * if A.ndim != 2: # <<<<<<<<<<<<<<
3153  * raise ValueError('Input matrix should be a 2-dimensional array.')
3154  *
3155  */
3156  __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
3157  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
3158  __Pyx_GOTREF(__pyx_t_3);
3159  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
3160  __Pyx_GOTREF(__pyx_t_4);
3161  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3162  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
3163  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3164  if (unlikely(__pyx_t_2)) {
3165 
3166  /* "imate/_c_linear_operator/py_c_matrix.pyx":129
3167  *
3168  * if A.ndim != 2:
3169  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
3170  *
3171  * # Data type
3172  */
3173  __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
3174  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
3175  __Pyx_GOTREF(__pyx_t_4);
3176  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3177  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3178  __PYX_ERR(0, 129, __pyx_L1_error)
3179 
3180  /* "imate/_c_linear_operator/py_c_matrix.pyx":128
3181  * raise ValueError('A cannot be None.')
3182  *
3183  * if A.ndim != 2: # <<<<<<<<<<<<<<
3184  * raise ValueError('Input matrix should be a 2-dimensional array.')
3185  *
3186  */
3187  }
3188 
3189  /* "imate/_c_linear_operator/py_c_matrix.pyx":132
3190  *
3191  * # Data type
3192  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3193  * self.data_type_name = b'float32'
3194  *
3195  */
3196  __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
3197  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
3198  __Pyx_GOTREF(__pyx_t_4);
3199  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
3200  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3201  if (__pyx_t_2) {
3202 
3203  /* "imate/_c_linear_operator/py_c_matrix.pyx":133
3204  * # Data type
3205  * if A.dtype == b'float32':
3206  * self.data_type_name = b'float32' # <<<<<<<<<<<<<<
3207  *
3208  * elif A.dtype == b'float64':
3209  */
3210  __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
3211  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float32");
3212 
3213  /* "imate/_c_linear_operator/py_c_matrix.pyx":132
3214  *
3215  * # Data type
3216  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3217  * self.data_type_name = b'float32'
3218  *
3219  */
3220  goto __pyx_L5;
3221  }
3222 
3223  /* "imate/_c_linear_operator/py_c_matrix.pyx":135
3224  * self.data_type_name = b'float32'
3225  *
3226  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3227  * self.data_type_name = b'float64'
3228  *
3229  */
3230  __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
3231  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3232  __Pyx_GOTREF(__pyx_t_4);
3233  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
3234  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3235  if (__pyx_t_2) {
3236 
3237  /* "imate/_c_linear_operator/py_c_matrix.pyx":136
3238  *
3239  * elif A.dtype == b'float64':
3240  * self.data_type_name = b'float64' # <<<<<<<<<<<<<<
3241  *
3242  * elif A.dtype == b'float128':
3243  */
3244  __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
3245  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float64");
3246 
3247  /* "imate/_c_linear_operator/py_c_matrix.pyx":135
3248  * self.data_type_name = b'float32'
3249  *
3250  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3251  * self.data_type_name = b'float64'
3252  *
3253  */
3254  goto __pyx_L5;
3255  }
3256 
3257  /* "imate/_c_linear_operator/py_c_matrix.pyx":138
3258  * self.data_type_name = b'float64'
3259  *
3260  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3261  * self.data_type_name = b'float128'
3262  *
3263  */
3264  __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
3265  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
3266  __Pyx_GOTREF(__pyx_t_4);
3267  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
3268  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3269  if (likely(__pyx_t_2)) {
3270 
3271  /* "imate/_c_linear_operator/py_c_matrix.pyx":139
3272  *
3273  * elif A.dtype == b'float128':
3274  * self.data_type_name = b'float128' # <<<<<<<<<<<<<<
3275  *
3276  * else:
3277  */
3278  __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3279  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float128");
3280 
3281  /* "imate/_c_linear_operator/py_c_matrix.pyx":138
3282  * self.data_type_name = b'float64'
3283  *
3284  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3285  * self.data_type_name = b'float128'
3286  *
3287  */
3288  goto __pyx_L5;
3289  }
3290 
3291  /* "imate/_c_linear_operator/py_c_matrix.pyx":142
3292  *
3293  * else:
3294  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
3295  * '"float128".')
3296  *
3297  */
3298  __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3299  /*else*/ {
3300  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3301  __Pyx_GOTREF(__pyx_t_4);
3302  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3303  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3304  __PYX_ERR(0, 142, __pyx_L1_error)
3305  }
3306  __pyx_L5:;
3307 
3308  /* "imate/_c_linear_operator/py_c_matrix.pyx":146
3309  *
3310  * # Determine A is sparse or dense
3311  * if issparse(A): # <<<<<<<<<<<<<<
3312  *
3313  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3314  */
3315  __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
3316  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3317  __Pyx_GOTREF(__pyx_t_3);
3318  __pyx_t_5 = NULL;
3319  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3320  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3321  if (likely(__pyx_t_5)) {
3322  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3323  __Pyx_INCREF(__pyx_t_5);
3324  __Pyx_INCREF(function);
3325  __Pyx_DECREF_SET(__pyx_t_3, function);
3326  }
3327  }
3328  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3329  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3330  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3331  __Pyx_GOTREF(__pyx_t_4);
3332  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3333  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3334  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3335  if (__pyx_t_2) {
3336 
3337  /* "imate/_c_linear_operator/py_c_matrix.pyx":149
3338  *
3339  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3340  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3341  *
3342  * # Check sorted indices
3343  */
3344  __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
3345  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
3346  __Pyx_GOTREF(__pyx_t_3);
3347  __pyx_t_5 = NULL;
3348  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3349  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3350  if (likely(__pyx_t_5)) {
3351  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3352  __Pyx_INCREF(__pyx_t_5);
3353  __Pyx_INCREF(function);
3354  __Pyx_DECREF_SET(__pyx_t_3, function);
3355  }
3356  }
3357  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3358  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3359  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
3360  __Pyx_GOTREF(__pyx_t_4);
3361  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3362  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3363  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3364  if (__pyx_t_2) {
3365 
3366  /* "imate/_c_linear_operator/py_c_matrix.pyx":152
3367  *
3368  * # Check sorted indices
3369  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3370  * A.sort_indices()
3371  *
3372  */
3373  __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
3374  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3375  __Pyx_GOTREF(__pyx_t_4);
3376  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3377  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3378  __pyx_t_1 = ((!__pyx_t_2) != 0);
3379  if (__pyx_t_1) {
3380 
3381  /* "imate/_c_linear_operator/py_c_matrix.pyx":153
3382  * # Check sorted indices
3383  * if not A.has_sorted_indices:
3384  * A.sort_indices() # <<<<<<<<<<<<<<
3385  *
3386  * # CSR matrix
3387  */
3388  __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
3389  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3390  __Pyx_GOTREF(__pyx_t_3);
3391  __pyx_t_5 = NULL;
3392  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3393  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3394  if (likely(__pyx_t_5)) {
3395  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3396  __Pyx_INCREF(__pyx_t_5);
3397  __Pyx_INCREF(function);
3398  __Pyx_DECREF_SET(__pyx_t_3, function);
3399  }
3400  }
3401  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3402  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3403  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3404  __Pyx_GOTREF(__pyx_t_4);
3405  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3406  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3407 
3408  /* "imate/_c_linear_operator/py_c_matrix.pyx":152
3409  *
3410  * # Check sorted indices
3411  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3412  * A.sort_indices()
3413  *
3414  */
3415  }
3416 
3417  /* "imate/_c_linear_operator/py_c_matrix.pyx":156
3418  *
3419  * # CSR matrix
3420  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3421  * self.set_csr_matrix_float(A)
3422  *
3423  */
3424  __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
3425  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3426  __Pyx_GOTREF(__pyx_t_4);
3427  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3428  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3429  if (__pyx_t_1) {
3430 
3431  /* "imate/_c_linear_operator/py_c_matrix.pyx":157
3432  * # CSR matrix
3433  * if self.data_type_name == b'float32':
3434  * self.set_csr_matrix_float(A) # <<<<<<<<<<<<<<
3435  *
3436  * elif self.data_type_name == b'float64':
3437  */
3438  __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3439  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3440  __Pyx_GOTREF(__pyx_t_3);
3441  __pyx_t_5 = NULL;
3442  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3443  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3444  if (likely(__pyx_t_5)) {
3445  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3446  __Pyx_INCREF(__pyx_t_5);
3447  __Pyx_INCREF(function);
3448  __Pyx_DECREF_SET(__pyx_t_3, function);
3449  }
3450  }
3451  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3452  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3453  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3454  __Pyx_GOTREF(__pyx_t_4);
3455  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3456  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3457 
3458  /* "imate/_c_linear_operator/py_c_matrix.pyx":156
3459  *
3460  * # CSR matrix
3461  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3462  * self.set_csr_matrix_float(A)
3463  *
3464  */
3465  goto __pyx_L9;
3466  }
3467 
3468  /* "imate/_c_linear_operator/py_c_matrix.pyx":159
3469  * self.set_csr_matrix_float(A)
3470  *
3471  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3472  * self.set_csr_matrix_double(A)
3473  *
3474  */
3475  __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
3476  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3477  __Pyx_GOTREF(__pyx_t_4);
3478  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3479  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3480  if (__pyx_t_1) {
3481 
3482  /* "imate/_c_linear_operator/py_c_matrix.pyx":160
3483  *
3484  * elif self.data_type_name == b'float64':
3485  * self.set_csr_matrix_double(A) # <<<<<<<<<<<<<<
3486  *
3487  * elif self.data_type_name == b'float128':
3488  */
3489  __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
3490  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
3491  __Pyx_GOTREF(__pyx_t_3);
3492  __pyx_t_5 = NULL;
3493  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3494  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3495  if (likely(__pyx_t_5)) {
3496  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3497  __Pyx_INCREF(__pyx_t_5);
3498  __Pyx_INCREF(function);
3499  __Pyx_DECREF_SET(__pyx_t_3, function);
3500  }
3501  }
3502  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3503  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3504  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3505  __Pyx_GOTREF(__pyx_t_4);
3506  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3507  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3508 
3509  /* "imate/_c_linear_operator/py_c_matrix.pyx":159
3510  * self.set_csr_matrix_float(A)
3511  *
3512  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3513  * self.set_csr_matrix_double(A)
3514  *
3515  */
3516  goto __pyx_L9;
3517  }
3518 
3519  /* "imate/_c_linear_operator/py_c_matrix.pyx":162
3520  * self.set_csr_matrix_double(A)
3521  *
3522  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3523  * self.set_csr_matrix_long_double(A)
3524  *
3525  */
3526  __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
3527  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3528  __Pyx_GOTREF(__pyx_t_4);
3529  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
3530  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3531  if (__pyx_t_1) {
3532 
3533  /* "imate/_c_linear_operator/py_c_matrix.pyx":163
3534  *
3535  * elif self.data_type_name == b'float128':
3536  * self.set_csr_matrix_long_double(A) # <<<<<<<<<<<<<<
3537  *
3538  * elif isspmatrix_csc(A):
3539  */
3540  __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
3541  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3542  __Pyx_GOTREF(__pyx_t_3);
3543  __pyx_t_5 = NULL;
3544  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3545  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3546  if (likely(__pyx_t_5)) {
3547  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3548  __Pyx_INCREF(__pyx_t_5);
3549  __Pyx_INCREF(function);
3550  __Pyx_DECREF_SET(__pyx_t_3, function);
3551  }
3552  }
3553  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3554  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3555  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3556  __Pyx_GOTREF(__pyx_t_4);
3557  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3558  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3559 
3560  /* "imate/_c_linear_operator/py_c_matrix.pyx":162
3561  * self.set_csr_matrix_double(A)
3562  *
3563  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3564  * self.set_csr_matrix_long_double(A)
3565  *
3566  */
3567  }
3568  __pyx_L9:;
3569 
3570  /* "imate/_c_linear_operator/py_c_matrix.pyx":149
3571  *
3572  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3573  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3574  *
3575  * # Check sorted indices
3576  */
3577  goto __pyx_L7;
3578  }
3579 
3580  /* "imate/_c_linear_operator/py_c_matrix.pyx":165
3581  * self.set_csr_matrix_long_double(A)
3582  *
3583  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3584  *
3585  * # Check sorted indices
3586  */
3587  __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
3588  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
3589  __Pyx_GOTREF(__pyx_t_3);
3590  __pyx_t_5 = NULL;
3591  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3592  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3593  if (likely(__pyx_t_5)) {
3594  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3595  __Pyx_INCREF(__pyx_t_5);
3596  __Pyx_INCREF(function);
3597  __Pyx_DECREF_SET(__pyx_t_3, function);
3598  }
3599  }
3600  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3601  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3602  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3603  __Pyx_GOTREF(__pyx_t_4);
3604  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3605  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3606  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3607  if (__pyx_t_1) {
3608 
3609  /* "imate/_c_linear_operator/py_c_matrix.pyx":168
3610  *
3611  * # Check sorted indices
3612  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3613  * A.sort_indices()
3614  *
3615  */
3616  __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
3617  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
3618  __Pyx_GOTREF(__pyx_t_4);
3619  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
3620  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3621  __pyx_t_2 = ((!__pyx_t_1) != 0);
3622  if (__pyx_t_2) {
3623 
3624  /* "imate/_c_linear_operator/py_c_matrix.pyx":169
3625  * # Check sorted indices
3626  * if not A.has_sorted_indices:
3627  * A.sort_indices() # <<<<<<<<<<<<<<
3628  *
3629  * # CSC matrix
3630  */
3631  __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
3632  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
3633  __Pyx_GOTREF(__pyx_t_3);
3634  __pyx_t_5 = NULL;
3635  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3636  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3637  if (likely(__pyx_t_5)) {
3638  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3639  __Pyx_INCREF(__pyx_t_5);
3640  __Pyx_INCREF(function);
3641  __Pyx_DECREF_SET(__pyx_t_3, function);
3642  }
3643  }
3644  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3645  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3646  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
3647  __Pyx_GOTREF(__pyx_t_4);
3648  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3649  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3650 
3651  /* "imate/_c_linear_operator/py_c_matrix.pyx":168
3652  *
3653  * # Check sorted indices
3654  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3655  * A.sort_indices()
3656  *
3657  */
3658  }
3659 
3660  /* "imate/_c_linear_operator/py_c_matrix.pyx":172
3661  *
3662  * # CSC matrix
3663  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3664  * self.set_csc_matrix_float(A)
3665  *
3666  */
3667  __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error))
3668  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
3669  __Pyx_GOTREF(__pyx_t_4);
3670  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3671  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3672  if (__pyx_t_2) {
3673 
3674  /* "imate/_c_linear_operator/py_c_matrix.pyx":173
3675  * # CSC matrix
3676  * if self.data_type_name == b'float32':
3677  * self.set_csc_matrix_float(A) # <<<<<<<<<<<<<<
3678  *
3679  * elif self.data_type_name == b'float64':
3680  */
3681  __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
3682  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
3683  __Pyx_GOTREF(__pyx_t_3);
3684  __pyx_t_5 = NULL;
3685  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3686  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3687  if (likely(__pyx_t_5)) {
3688  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3689  __Pyx_INCREF(__pyx_t_5);
3690  __Pyx_INCREF(function);
3691  __Pyx_DECREF_SET(__pyx_t_3, function);
3692  }
3693  }
3694  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3695  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3696  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3697  __Pyx_GOTREF(__pyx_t_4);
3698  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3699  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3700 
3701  /* "imate/_c_linear_operator/py_c_matrix.pyx":172
3702  *
3703  * # CSC matrix
3704  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3705  * self.set_csc_matrix_float(A)
3706  *
3707  */
3708  goto __pyx_L11;
3709  }
3710 
3711  /* "imate/_c_linear_operator/py_c_matrix.pyx":175
3712  * self.set_csc_matrix_float(A)
3713  *
3714  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3715  * self.set_csc_matrix_double(A)
3716  *
3717  */
3718  __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
3719  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3720  __Pyx_GOTREF(__pyx_t_4);
3721  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3722  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3723  if (__pyx_t_2) {
3724 
3725  /* "imate/_c_linear_operator/py_c_matrix.pyx":176
3726  *
3727  * elif self.data_type_name == b'float64':
3728  * self.set_csc_matrix_double(A) # <<<<<<<<<<<<<<
3729  *
3730  * elif self.data_type_name == b'float128':
3731  */
3732  __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
3733  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
3734  __Pyx_GOTREF(__pyx_t_3);
3735  __pyx_t_5 = NULL;
3736  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3737  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3738  if (likely(__pyx_t_5)) {
3739  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3740  __Pyx_INCREF(__pyx_t_5);
3741  __Pyx_INCREF(function);
3742  __Pyx_DECREF_SET(__pyx_t_3, function);
3743  }
3744  }
3745  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3746  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3747  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
3748  __Pyx_GOTREF(__pyx_t_4);
3749  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3750  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3751 
3752  /* "imate/_c_linear_operator/py_c_matrix.pyx":175
3753  * self.set_csc_matrix_float(A)
3754  *
3755  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3756  * self.set_csc_matrix_double(A)
3757  *
3758  */
3759  goto __pyx_L11;
3760  }
3761 
3762  /* "imate/_c_linear_operator/py_c_matrix.pyx":178
3763  * self.set_csc_matrix_double(A)
3764  *
3765  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3766  * self.set_csc_matrix_long_double(A)
3767  *
3768  */
3769  __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3770  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
3771  __Pyx_GOTREF(__pyx_t_4);
3772  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
3773  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3774  if (__pyx_t_2) {
3775 
3776  /* "imate/_c_linear_operator/py_c_matrix.pyx":179
3777  *
3778  * elif self.data_type_name == b'float128':
3779  * self.set_csc_matrix_long_double(A) # <<<<<<<<<<<<<<
3780  *
3781  * else:
3782  */
3783  __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3784  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3785  __Pyx_GOTREF(__pyx_t_3);
3786  __pyx_t_5 = NULL;
3787  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3788  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3789  if (likely(__pyx_t_5)) {
3790  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3791  __Pyx_INCREF(__pyx_t_5);
3792  __Pyx_INCREF(function);
3793  __Pyx_DECREF_SET(__pyx_t_3, function);
3794  }
3795  }
3796  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3797  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3798  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
3799  __Pyx_GOTREF(__pyx_t_4);
3800  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3801  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3802 
3803  /* "imate/_c_linear_operator/py_c_matrix.pyx":178
3804  * self.set_csc_matrix_double(A)
3805  *
3806  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3807  * self.set_csc_matrix_long_double(A)
3808  *
3809  */
3810  }
3811  __pyx_L11:;
3812 
3813  /* "imate/_c_linear_operator/py_c_matrix.pyx":165
3814  * self.set_csr_matrix_long_double(A)
3815  *
3816  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3817  *
3818  * # Check sorted indices
3819  */
3820  goto __pyx_L7;
3821  }
3822 
3823  /* "imate/_c_linear_operator/py_c_matrix.pyx":184
3824  *
3825  * # If A is neither CSR or CSC, convert A to CSR
3826  * self.A_csr = csr_matrix(A) # <<<<<<<<<<<<<<
3827  *
3828  * # Check sorted indices
3829  */
3830  __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
3831  /*else*/ {
3832  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
3833  __Pyx_GOTREF(__pyx_t_3);
3834  __pyx_t_5 = NULL;
3835  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3836  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3837  if (likely(__pyx_t_5)) {
3838  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3839  __Pyx_INCREF(__pyx_t_5);
3840  __Pyx_INCREF(function);
3841  __Pyx_DECREF_SET(__pyx_t_3, function);
3842  }
3843  }
3844  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3845  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3846  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
3847  __Pyx_GOTREF(__pyx_t_4);
3848  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3849  __Pyx_GIVEREF(__pyx_t_4);
3850  __Pyx_GOTREF(__pyx_v_self->A_csr);
3851  __Pyx_DECREF(__pyx_v_self->A_csr);
3852  __pyx_v_self->A_csr = __pyx_t_4;
3853  __pyx_t_4 = 0;
3854 
3855  /* "imate/_c_linear_operator/py_c_matrix.pyx":187
3856  *
3857  * # Check sorted indices
3858  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
3859  * self.A_csr.sort_indices()
3860  *
3861  */
3862  __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3863  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3864  __Pyx_GOTREF(__pyx_t_4);
3865  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3866  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3867  __pyx_t_1 = ((!__pyx_t_2) != 0);
3868  if (__pyx_t_1) {
3869 
3870  /* "imate/_c_linear_operator/py_c_matrix.pyx":188
3871  * # Check sorted indices
3872  * if not self.A_csr.has_sorted_indices:
3873  * self.A_csr.sort_indices() # <<<<<<<<<<<<<<
3874  *
3875  * # CSR matrix
3876  */
3877  __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3878  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
3879  __Pyx_GOTREF(__pyx_t_3);
3880  __pyx_t_5 = NULL;
3881  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3882  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3883  if (likely(__pyx_t_5)) {
3884  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3885  __Pyx_INCREF(__pyx_t_5);
3886  __Pyx_INCREF(function);
3887  __Pyx_DECREF_SET(__pyx_t_3, function);
3888  }
3889  }
3890  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3891  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3892  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
3893  __Pyx_GOTREF(__pyx_t_4);
3894  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3896 
3897  /* "imate/_c_linear_operator/py_c_matrix.pyx":187
3898  *
3899  * # Check sorted indices
3900  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
3901  * self.A_csr.sort_indices()
3902  *
3903  */
3904  }
3905 
3906  /* "imate/_c_linear_operator/py_c_matrix.pyx":191
3907  *
3908  * # CSR matrix
3909  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3910  * self.set_csr_matrix_float(self.A_csr)
3911  *
3912  */
3913  __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
3914  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
3915  __Pyx_GOTREF(__pyx_t_4);
3916  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
3917  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3918  if (__pyx_t_1) {
3919 
3920  /* "imate/_c_linear_operator/py_c_matrix.pyx":192
3921  * # CSR matrix
3922  * if self.data_type_name == b'float32':
3923  * self.set_csr_matrix_float(self.A_csr) # <<<<<<<<<<<<<<
3924  *
3925  * elif self.data_type_name == b'float64':
3926  */
3927  __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3928  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
3929  __Pyx_GOTREF(__pyx_t_3);
3930  __pyx_t_5 = NULL;
3931  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3932  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3933  if (likely(__pyx_t_5)) {
3934  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3935  __Pyx_INCREF(__pyx_t_5);
3936  __Pyx_INCREF(function);
3937  __Pyx_DECREF_SET(__pyx_t_3, function);
3938  }
3939  }
3940  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3941  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3942  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3943  __Pyx_GOTREF(__pyx_t_4);
3944  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3945  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3946 
3947  /* "imate/_c_linear_operator/py_c_matrix.pyx":191
3948  *
3949  * # CSR matrix
3950  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3951  * self.set_csr_matrix_float(self.A_csr)
3952  *
3953  */
3954  goto __pyx_L13;
3955  }
3956 
3957  /* "imate/_c_linear_operator/py_c_matrix.pyx":194
3958  * self.set_csr_matrix_float(self.A_csr)
3959  *
3960  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3961  * self.set_csr_matrix_double(self.A_csr)
3962  *
3963  */
3964  __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
3965  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
3966  __Pyx_GOTREF(__pyx_t_4);
3967  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
3968  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3969  if (__pyx_t_1) {
3970 
3971  /* "imate/_c_linear_operator/py_c_matrix.pyx":195
3972  *
3973  * elif self.data_type_name == b'float64':
3974  * self.set_csr_matrix_double(self.A_csr) # <<<<<<<<<<<<<<
3975  *
3976  * elif self.data_type_name == b'float128':
3977  */
3978  __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
3979  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
3980  __Pyx_GOTREF(__pyx_t_3);
3981  __pyx_t_5 = NULL;
3982  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3983  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3984  if (likely(__pyx_t_5)) {
3985  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3986  __Pyx_INCREF(__pyx_t_5);
3987  __Pyx_INCREF(function);
3988  __Pyx_DECREF_SET(__pyx_t_3, function);
3989  }
3990  }
3991  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3992  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3993  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
3994  __Pyx_GOTREF(__pyx_t_4);
3995  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3996  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3997 
3998  /* "imate/_c_linear_operator/py_c_matrix.pyx":194
3999  * self.set_csr_matrix_float(self.A_csr)
4000  *
4001  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4002  * self.set_csr_matrix_double(self.A_csr)
4003  *
4004  */
4005  goto __pyx_L13;
4006  }
4007 
4008  /* "imate/_c_linear_operator/py_c_matrix.pyx":197
4009  * self.set_csr_matrix_double(self.A_csr)
4010  *
4011  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4012  * self.set_csr_matrix_long_double(self.A_csr)
4013  *
4014  */
4015  __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error))
4016  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
4017  __Pyx_GOTREF(__pyx_t_4);
4018  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
4019  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4020  if (__pyx_t_1) {
4021 
4022  /* "imate/_c_linear_operator/py_c_matrix.pyx":198
4023  *
4024  * elif self.data_type_name == b'float128':
4025  * self.set_csr_matrix_long_double(self.A_csr) # <<<<<<<<<<<<<<
4026  *
4027  * else:
4028  */
4029  __Pyx_TraceLine(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
4030  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
4031  __Pyx_GOTREF(__pyx_t_3);
4032  __pyx_t_5 = NULL;
4033  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4034  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4035  if (likely(__pyx_t_5)) {
4036  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4037  __Pyx_INCREF(__pyx_t_5);
4038  __Pyx_INCREF(function);
4039  __Pyx_DECREF_SET(__pyx_t_3, function);
4040  }
4041  }
4042  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4043  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4044  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
4045  __Pyx_GOTREF(__pyx_t_4);
4046  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4047  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4048 
4049  /* "imate/_c_linear_operator/py_c_matrix.pyx":197
4050  * self.set_csr_matrix_double(self.A_csr)
4051  *
4052  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4053  * self.set_csr_matrix_long_double(self.A_csr)
4054  *
4055  */
4056  }
4057  __pyx_L13:;
4058  }
4059  __pyx_L7:;
4060 
4061  /* "imate/_c_linear_operator/py_c_matrix.pyx":146
4062  *
4063  * # Determine A is sparse or dense
4064  * if issparse(A): # <<<<<<<<<<<<<<
4065  *
4066  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
4067  */
4068  goto __pyx_L6;
4069  }
4070 
4071  /* "imate/_c_linear_operator/py_c_matrix.pyx":203
4072  *
4073  * # Set a dense matrix
4074  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4075  * self.set_dense_matrix_float(A)
4076  *
4077  */
4078  __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
4079  /*else*/ {
4080  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
4081  __Pyx_GOTREF(__pyx_t_4);
4082  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
4083  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4084  if (__pyx_t_1) {
4085 
4086  /* "imate/_c_linear_operator/py_c_matrix.pyx":204
4087  * # Set a dense matrix
4088  * if self.data_type_name == b'float32':
4089  * self.set_dense_matrix_float(A) # <<<<<<<<<<<<<<
4090  *
4091  * elif self.data_type_name == b'float64':
4092  */
4093  __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
4094  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4095  __Pyx_GOTREF(__pyx_t_3);
4096  __pyx_t_5 = NULL;
4097  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4098  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4099  if (likely(__pyx_t_5)) {
4100  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4101  __Pyx_INCREF(__pyx_t_5);
4102  __Pyx_INCREF(function);
4103  __Pyx_DECREF_SET(__pyx_t_3, function);
4104  }
4105  }
4106  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4107  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4108  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
4109  __Pyx_GOTREF(__pyx_t_4);
4110  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4111  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4112 
4113  /* "imate/_c_linear_operator/py_c_matrix.pyx":203
4114  *
4115  * # Set a dense matrix
4116  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4117  * self.set_dense_matrix_float(A)
4118  *
4119  */
4120  goto __pyx_L14;
4121  }
4122 
4123  /* "imate/_c_linear_operator/py_c_matrix.pyx":206
4124  * self.set_dense_matrix_float(A)
4125  *
4126  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4127  * self.set_dense_matrix_double(A)
4128  *
4129  */
4130  __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
4131  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
4132  __Pyx_GOTREF(__pyx_t_4);
4133  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
4134  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4135  if (__pyx_t_1) {
4136 
4137  /* "imate/_c_linear_operator/py_c_matrix.pyx":207
4138  *
4139  * elif self.data_type_name == b'float64':
4140  * self.set_dense_matrix_double(A) # <<<<<<<<<<<<<<
4141  *
4142  * elif self.data_type_name == b'float128':
4143  */
4144  __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4145  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
4146  __Pyx_GOTREF(__pyx_t_3);
4147  __pyx_t_5 = NULL;
4148  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4149  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4150  if (likely(__pyx_t_5)) {
4151  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4152  __Pyx_INCREF(__pyx_t_5);
4153  __Pyx_INCREF(function);
4154  __Pyx_DECREF_SET(__pyx_t_3, function);
4155  }
4156  }
4157  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4158  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4159  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
4160  __Pyx_GOTREF(__pyx_t_4);
4161  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4162  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4163 
4164  /* "imate/_c_linear_operator/py_c_matrix.pyx":206
4165  * self.set_dense_matrix_float(A)
4166  *
4167  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4168  * self.set_dense_matrix_double(A)
4169  *
4170  */
4171  goto __pyx_L14;
4172  }
4173 
4174  /* "imate/_c_linear_operator/py_c_matrix.pyx":209
4175  * self.set_dense_matrix_double(A)
4176  *
4177  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4178  * self.set_dense_matrix_long_double(A)
4179  *
4180  */
4181  __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
4182  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
4183  __Pyx_GOTREF(__pyx_t_4);
4184  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
4185  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4186  if (__pyx_t_1) {
4187 
4188  /* "imate/_c_linear_operator/py_c_matrix.pyx":210
4189  *
4190  * elif self.data_type_name == b'float128':
4191  * self.set_dense_matrix_long_double(A) # <<<<<<<<<<<<<<
4192  *
4193  * # ======================
4194  */
4195  __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
4196  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4197  __Pyx_GOTREF(__pyx_t_3);
4198  __pyx_t_5 = NULL;
4199  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4200  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4201  if (likely(__pyx_t_5)) {
4202  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4203  __Pyx_INCREF(__pyx_t_5);
4204  __Pyx_INCREF(function);
4205  __Pyx_DECREF_SET(__pyx_t_3, function);
4206  }
4207  }
4208  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4209  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4210  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
4211  __Pyx_GOTREF(__pyx_t_4);
4212  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4213  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4214 
4215  /* "imate/_c_linear_operator/py_c_matrix.pyx":209
4216  * self.set_dense_matrix_double(A)
4217  *
4218  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4219  * self.set_dense_matrix_long_double(A)
4220  *
4221  */
4222  }
4223  __pyx_L14:;
4224  }
4225  __pyx_L6:;
4226 
4227  /* "imate/_c_linear_operator/py_c_matrix.pyx":119
4228  * # =========
4229  *
4230  * def __cinit__(self, A): # <<<<<<<<<<<<<<
4231  * """
4232  * Sets the matrix A.
4233  */
4234 
4235  /* function exit code */
4236  __pyx_r = 0;
4237  goto __pyx_L0;
4238  __pyx_L1_error:;
4239  __Pyx_XDECREF(__pyx_t_3);
4240  __Pyx_XDECREF(__pyx_t_4);
4241  __Pyx_XDECREF(__pyx_t_5);
4242  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4243  __pyx_r = -1;
4244  __pyx_L0:;
4245  __Pyx_TraceReturn(Py_None, 0);
4246  __Pyx_RefNannyFinishContext();
4247  return __pyx_r;
4248 }
4249 
4250 /* "imate/_c_linear_operator/py_c_matrix.pyx":216
4251  * # ======================
4252  *
4253  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
4254  * """
4255  * Sets matrix A.
4256  */
4257 
4258 /* Python wrapper */
4259 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4260 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float[] = "pycMatrix.set_dense_matrix_float(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4261 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float = {"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float};
4262 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4263  PyObject *__pyx_r = 0;
4264  __Pyx_RefNannyDeclarations
4265  __Pyx_RefNannySetupContext("set_dense_matrix_float (wrapper)", 0);
4266  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4267 
4268  /* function exit code */
4269  __Pyx_RefNannyFinishContext();
4270  return __pyx_r;
4271 }
4272 
4273 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4274  LongIndexType __pyx_v_A_num_rows;
4275  LongIndexType __pyx_v_A_num_columns;
4276  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4277  __Pyx_memviewslice __pyx_v_A_data_float_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4278  __Pyx_memviewslice __pyx_v_A_data_float_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4279  float *__pyx_v_A_data_float;
4280  PyObject *__pyx_r = NULL;
4281  __Pyx_TraceDeclarations
4282  __Pyx_RefNannyDeclarations
4283  PyObject *__pyx_t_1 = NULL;
4284  PyObject *__pyx_t_2 = NULL;
4285  LongIndexType __pyx_t_3;
4286  int __pyx_t_4;
4287  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4288  Py_ssize_t __pyx_t_6;
4289  Py_ssize_t __pyx_t_7;
4290  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4291  cDenseMatrix<float> *__pyx_t_9;
4292  int __pyx_lineno = 0;
4293  const char *__pyx_filename = NULL;
4294  int __pyx_clineno = 0;
4295  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4296  __Pyx_RefNannySetupContext("set_dense_matrix_float", 0);
4297  __Pyx_TraceCall("set_dense_matrix_float", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
4298 
4299  /* "imate/_c_linear_operator/py_c_matrix.pyx":225
4300  *
4301  * # Matrix size
4302  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4303  * cdef LongIndexType A_num_columns = A.shape[1]
4304  *
4305  */
4306  __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
4307  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
4308  __Pyx_GOTREF(__pyx_t_1);
4309  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
4310  __Pyx_GOTREF(__pyx_t_2);
4311  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4312  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4313  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4314  __pyx_v_A_num_rows = __pyx_t_3;
4315 
4316  /* "imate/_c_linear_operator/py_c_matrix.pyx":226
4317  * # Matrix size
4318  * cdef LongIndexType A_num_rows = A.shape[0]
4319  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4320  *
4321  * # Contiguity
4322  */
4323  __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
4324  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
4325  __Pyx_GOTREF(__pyx_t_2);
4326  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
4327  __Pyx_GOTREF(__pyx_t_1);
4328  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4329  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
4330  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4331  __pyx_v_A_num_columns = __pyx_t_3;
4332 
4333  /* "imate/_c_linear_operator/py_c_matrix.pyx":230
4334  * # Contiguity
4335  * cdef FlagType A_is_row_major
4336  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4337  * A_is_row_major = 1
4338  * elif A.flags['F_CONTIGUOUS']:
4339  */
4340  __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4341  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4342  __Pyx_GOTREF(__pyx_t_1);
4343  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4344  __Pyx_GOTREF(__pyx_t_2);
4345  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4346  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
4347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4348  if (__pyx_t_4) {
4349 
4350  /* "imate/_c_linear_operator/py_c_matrix.pyx":231
4351  * cdef FlagType A_is_row_major
4352  * if A.flags['C_CONTIGUOUS']:
4353  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4354  * elif A.flags['F_CONTIGUOUS']:
4355  * A_is_row_major = 0
4356  */
4357  __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
4358  __pyx_v_A_is_row_major = 1;
4359 
4360  /* "imate/_c_linear_operator/py_c_matrix.pyx":230
4361  * # Contiguity
4362  * cdef FlagType A_is_row_major
4363  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4364  * A_is_row_major = 1
4365  * elif A.flags['F_CONTIGUOUS']:
4366  */
4367  goto __pyx_L3;
4368  }
4369 
4370  /* "imate/_c_linear_operator/py_c_matrix.pyx":232
4371  * if A.flags['C_CONTIGUOUS']:
4372  * A_is_row_major = 1
4373  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4374  * A_is_row_major = 0
4375  * else:
4376  */
4377  __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4378  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
4379  __Pyx_GOTREF(__pyx_t_2);
4380  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
4381  __Pyx_GOTREF(__pyx_t_1);
4382  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4383  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
4384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4385  if (likely(__pyx_t_4)) {
4386 
4387  /* "imate/_c_linear_operator/py_c_matrix.pyx":233
4388  * A_is_row_major = 1
4389  * elif A.flags['F_CONTIGUOUS']:
4390  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4391  * else:
4392  * raise TypeError('Matrix A should be either C or F contiguous.')
4393  */
4394  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
4395  __pyx_v_A_is_row_major = 0;
4396 
4397  /* "imate/_c_linear_operator/py_c_matrix.pyx":232
4398  * if A.flags['C_CONTIGUOUS']:
4399  * A_is_row_major = 1
4400  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4401  * A_is_row_major = 0
4402  * else:
4403  */
4404  goto __pyx_L3;
4405  }
4406 
4407  /* "imate/_c_linear_operator/py_c_matrix.pyx":235
4408  * A_is_row_major = 0
4409  * else:
4410  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4411  *
4412  * # Declare memoryviews to get data pointer
4413  */
4414  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
4415  /*else*/ {
4416  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
4417  __Pyx_GOTREF(__pyx_t_1);
4418  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4419  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4420  __PYX_ERR(0, 235, __pyx_L1_error)
4421  }
4422  __pyx_L3:;
4423 
4424  /* "imate/_c_linear_operator/py_c_matrix.pyx":245
4425  *
4426  * # Get pointer to data of A depending on row or column major
4427  * if A_is_row_major: # <<<<<<<<<<<<<<
4428  *
4429  * # Memoryview of A for row major matrix
4430  */
4431  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4432  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4433  if (__pyx_t_4) {
4434 
4435  /* "imate/_c_linear_operator/py_c_matrix.pyx":248
4436  *
4437  * # Memoryview of A for row major matrix
4438  * A_data_float_mv_c = A # <<<<<<<<<<<<<<
4439  *
4440  * # Pointer of the data of A
4441  */
4442  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4443  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
4444  __pyx_v_A_data_float_mv_c = __pyx_t_5;
4445  __pyx_t_5.memview = NULL;
4446  __pyx_t_5.data = NULL;
4447 
4448  /* "imate/_c_linear_operator/py_c_matrix.pyx":251
4449  *
4450  * # Pointer of the data of A
4451  * A_data_float = &A_data_float_mv_c[0, 0] # <<<<<<<<<<<<<<
4452  *
4453  * else:
4454  */
4455  __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4456  __pyx_t_6 = 0;
4457  __pyx_t_7 = 0;
4458  __pyx_v_A_data_float = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv_c.data + __pyx_t_6 * __pyx_v_A_data_float_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4459 
4460  /* "imate/_c_linear_operator/py_c_matrix.pyx":245
4461  *
4462  * # Get pointer to data of A depending on row or column major
4463  * if A_is_row_major: # <<<<<<<<<<<<<<
4464  *
4465  * # Memoryview of A for row major matrix
4466  */
4467  goto __pyx_L4;
4468  }
4469 
4470  /* "imate/_c_linear_operator/py_c_matrix.pyx":256
4471  *
4472  * # Memoryview of A for column major matrix
4473  * A_data_float_mv_f = A # <<<<<<<<<<<<<<
4474  *
4475  * # Pointer of the data of A
4476  */
4477  __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
4478  /*else*/ {
4479  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
4480  __pyx_v_A_data_float_mv_f = __pyx_t_8;
4481  __pyx_t_8.memview = NULL;
4482  __pyx_t_8.data = NULL;
4483 
4484  /* "imate/_c_linear_operator/py_c_matrix.pyx":259
4485  *
4486  * # Pointer of the data of A
4487  * A_data_float = &A_data_float_mv_f[0, 0] # <<<<<<<<<<<<<<
4488  *
4489  * # Create a linear operator object
4490  */
4491  __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
4492  __pyx_t_7 = 0;
4493  __pyx_t_6 = 0;
4494  __pyx_v_A_data_float = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_A_data_float_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_float_mv_f.strides[1]) ))));
4495  }
4496  __pyx_L4:;
4497 
4498  /* "imate/_c_linear_operator/py_c_matrix.pyx":262
4499  *
4500  * # Create a linear operator object
4501  * self.Aop_float = new cDenseMatrix[float]( # <<<<<<<<<<<<<<
4502  * A_data_float,
4503  * A_num_rows,
4504  */
4505  __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
4506  try {
4507  __pyx_t_9 = new cDenseMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4508  } catch(...) {
4509  __Pyx_CppExn2PyErr();
4510  __PYX_ERR(0, 262, __pyx_L1_error)
4511  }
4512  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
4513 
4514  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
4515  * # ======================
4516  *
4517  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
4518  * """
4519  * Sets matrix A.
4520  */
4521 
4522  /* function exit code */
4523  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4524  goto __pyx_L0;
4525  __pyx_L1_error:;
4526  __Pyx_XDECREF(__pyx_t_1);
4527  __Pyx_XDECREF(__pyx_t_2);
4528  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4529  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4530  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4531  __pyx_r = NULL;
4532  __pyx_L0:;
4533  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_c, 1);
4534  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_f, 1);
4535  __Pyx_XGIVEREF(__pyx_r);
4536  __Pyx_TraceReturn(__pyx_r, 0);
4537  __Pyx_RefNannyFinishContext();
4538  return __pyx_r;
4539 }
4540 
4541 /* "imate/_c_linear_operator/py_c_matrix.pyx":272
4542  * # =======================
4543  *
4544  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
4545  * """
4546  * Sets matrix A.
4547  */
4548 
4549 /* Python wrapper */
4550 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4551 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double[] = "pycMatrix.set_dense_matrix_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4552 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double = {"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double};
4553 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4554  PyObject *__pyx_r = 0;
4555  __Pyx_RefNannyDeclarations
4556  __Pyx_RefNannySetupContext("set_dense_matrix_double (wrapper)", 0);
4557  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4558 
4559  /* function exit code */
4560  __Pyx_RefNannyFinishContext();
4561  return __pyx_r;
4562 }
4563 
4564 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4565  LongIndexType __pyx_v_A_num_rows;
4566  LongIndexType __pyx_v_A_num_columns;
4567  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4568  __Pyx_memviewslice __pyx_v_A_data_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4569  __Pyx_memviewslice __pyx_v_A_data_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4570  double *__pyx_v_A_data_double;
4571  PyObject *__pyx_r = NULL;
4572  __Pyx_TraceDeclarations
4573  __Pyx_RefNannyDeclarations
4574  PyObject *__pyx_t_1 = NULL;
4575  PyObject *__pyx_t_2 = NULL;
4576  LongIndexType __pyx_t_3;
4577  int __pyx_t_4;
4578  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4579  Py_ssize_t __pyx_t_6;
4580  Py_ssize_t __pyx_t_7;
4581  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4582  cDenseMatrix<double> *__pyx_t_9;
4583  int __pyx_lineno = 0;
4584  const char *__pyx_filename = NULL;
4585  int __pyx_clineno = 0;
4586  __Pyx_TraceFrameInit(__pyx_codeobj__6)
4587  __Pyx_RefNannySetupContext("set_dense_matrix_double", 0);
4588  __Pyx_TraceCall("set_dense_matrix_double", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
4589 
4590  /* "imate/_c_linear_operator/py_c_matrix.pyx":281
4591  *
4592  * # Matrix size
4593  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4594  * cdef LongIndexType A_num_columns = A.shape[1]
4595  *
4596  */
4597  __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
4598  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
4599  __Pyx_GOTREF(__pyx_t_1);
4600  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
4601  __Pyx_GOTREF(__pyx_t_2);
4602  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4603  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4604  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4605  __pyx_v_A_num_rows = __pyx_t_3;
4606 
4607  /* "imate/_c_linear_operator/py_c_matrix.pyx":282
4608  * # Matrix size
4609  * cdef LongIndexType A_num_rows = A.shape[0]
4610  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4611  *
4612  * # Contiguity
4613  */
4614  __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4615  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
4616  __Pyx_GOTREF(__pyx_t_2);
4617  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
4618  __Pyx_GOTREF(__pyx_t_1);
4619  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4620  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
4621  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4622  __pyx_v_A_num_columns = __pyx_t_3;
4623 
4624  /* "imate/_c_linear_operator/py_c_matrix.pyx":286
4625  * # Contiguity
4626  * cdef FlagType A_is_row_major
4627  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4628  * A_is_row_major = 1
4629  * elif A.flags['F_CONTIGUOUS']:
4630  */
4631  __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4632  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
4633  __Pyx_GOTREF(__pyx_t_1);
4634  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
4635  __Pyx_GOTREF(__pyx_t_2);
4636  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4637  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4638  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4639  if (__pyx_t_4) {
4640 
4641  /* "imate/_c_linear_operator/py_c_matrix.pyx":287
4642  * cdef FlagType A_is_row_major
4643  * if A.flags['C_CONTIGUOUS']:
4644  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4645  * elif A.flags['F_CONTIGUOUS']:
4646  * A_is_row_major = 0
4647  */
4648  __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4649  __pyx_v_A_is_row_major = 1;
4650 
4651  /* "imate/_c_linear_operator/py_c_matrix.pyx":286
4652  * # Contiguity
4653  * cdef FlagType A_is_row_major
4654  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4655  * A_is_row_major = 1
4656  * elif A.flags['F_CONTIGUOUS']:
4657  */
4658  goto __pyx_L3;
4659  }
4660 
4661  /* "imate/_c_linear_operator/py_c_matrix.pyx":288
4662  * if A.flags['C_CONTIGUOUS']:
4663  * A_is_row_major = 1
4664  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4665  * A_is_row_major = 0
4666  * else:
4667  */
4668  __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4669  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4670  __Pyx_GOTREF(__pyx_t_2);
4671  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
4672  __Pyx_GOTREF(__pyx_t_1);
4673  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4674  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
4675  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4676  if (likely(__pyx_t_4)) {
4677 
4678  /* "imate/_c_linear_operator/py_c_matrix.pyx":289
4679  * A_is_row_major = 1
4680  * elif A.flags['F_CONTIGUOUS']:
4681  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4682  * else:
4683  * raise TypeError('Matrix A should be either C or F contiguous.')
4684  */
4685  __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4686  __pyx_v_A_is_row_major = 0;
4687 
4688  /* "imate/_c_linear_operator/py_c_matrix.pyx":288
4689  * if A.flags['C_CONTIGUOUS']:
4690  * A_is_row_major = 1
4691  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4692  * A_is_row_major = 0
4693  * else:
4694  */
4695  goto __pyx_L3;
4696  }
4697 
4698  /* "imate/_c_linear_operator/py_c_matrix.pyx":291
4699  * A_is_row_major = 0
4700  * else:
4701  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4702  *
4703  * # Declare memoryviews to get data pointer
4704  */
4705  __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error))
4706  /*else*/ {
4707  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
4708  __Pyx_GOTREF(__pyx_t_1);
4709  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4710  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4711  __PYX_ERR(0, 291, __pyx_L1_error)
4712  }
4713  __pyx_L3:;
4714 
4715  /* "imate/_c_linear_operator/py_c_matrix.pyx":301
4716  *
4717  * # Get pointer to data of A depending on row or column major
4718  * if A_is_row_major: # <<<<<<<<<<<<<<
4719  *
4720  * # Memoryview of A for row major matrix
4721  */
4722  __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error))
4723  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4724  if (__pyx_t_4) {
4725 
4726  /* "imate/_c_linear_operator/py_c_matrix.pyx":304
4727  *
4728  * # Memoryview of A for row major matrix
4729  * A_data_double_mv_c = A # <<<<<<<<<<<<<<
4730  *
4731  * # Pointer of the data of A
4732  */
4733  __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error))
4734  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
4735  __pyx_v_A_data_double_mv_c = __pyx_t_5;
4736  __pyx_t_5.memview = NULL;
4737  __pyx_t_5.data = NULL;
4738 
4739  /* "imate/_c_linear_operator/py_c_matrix.pyx":307
4740  *
4741  * # Pointer of the data of A
4742  * A_data_double = &A_data_double_mv_c[0, 0] # <<<<<<<<<<<<<<
4743  *
4744  * else:
4745  */
4746  __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
4747  __pyx_t_6 = 0;
4748  __pyx_t_7 = 0;
4749  __pyx_v_A_data_double = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4750 
4751  /* "imate/_c_linear_operator/py_c_matrix.pyx":301
4752  *
4753  * # Get pointer to data of A depending on row or column major
4754  * if A_is_row_major: # <<<<<<<<<<<<<<
4755  *
4756  * # Memoryview of A for row major matrix
4757  */
4758  goto __pyx_L4;
4759  }
4760 
4761  /* "imate/_c_linear_operator/py_c_matrix.pyx":312
4762  *
4763  * # Memoryview of A for column major matrix
4764  * A_data_double_mv_f = A # <<<<<<<<<<<<<<
4765  *
4766  * # Pointer of the data of A
4767  */
4768  __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
4769  /*else*/ {
4770  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
4771  __pyx_v_A_data_double_mv_f = __pyx_t_8;
4772  __pyx_t_8.memview = NULL;
4773  __pyx_t_8.data = NULL;
4774 
4775  /* "imate/_c_linear_operator/py_c_matrix.pyx":315
4776  *
4777  * # Pointer of the data of A
4778  * A_data_double = &A_data_double_mv_f[0, 0] # <<<<<<<<<<<<<<
4779  *
4780  * # Create a linear operator object
4781  */
4782  __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
4783  __pyx_t_7 = 0;
4784  __pyx_t_6 = 0;
4785  __pyx_v_A_data_double = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_A_data_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_double_mv_f.strides[1]) ))));
4786  }
4787  __pyx_L4:;
4788 
4789  /* "imate/_c_linear_operator/py_c_matrix.pyx":318
4790  *
4791  * # Create a linear operator object
4792  * self.Aop_double = new cDenseMatrix[double]( # <<<<<<<<<<<<<<
4793  * A_data_double,
4794  * A_num_rows,
4795  */
4796  __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
4797  try {
4798  __pyx_t_9 = new cDenseMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4799  } catch(...) {
4800  __Pyx_CppExn2PyErr();
4801  __PYX_ERR(0, 318, __pyx_L1_error)
4802  }
4803  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
4804 
4805  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
4806  * # =======================
4807  *
4808  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
4809  * """
4810  * Sets matrix A.
4811  */
4812 
4813  /* function exit code */
4814  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4815  goto __pyx_L0;
4816  __pyx_L1_error:;
4817  __Pyx_XDECREF(__pyx_t_1);
4818  __Pyx_XDECREF(__pyx_t_2);
4819  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4820  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4821  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4822  __pyx_r = NULL;
4823  __pyx_L0:;
4824  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_c, 1);
4825  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_f, 1);
4826  __Pyx_XGIVEREF(__pyx_r);
4827  __Pyx_TraceReturn(__pyx_r, 0);
4828  __Pyx_RefNannyFinishContext();
4829  return __pyx_r;
4830 }
4831 
4832 /* "imate/_c_linear_operator/py_c_matrix.pyx":328
4833  * # ============================
4834  *
4835  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
4836  * """
4837  * Sets matrix A.
4838  */
4839 
4840 /* Python wrapper */
4841 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4842 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double[] = "pycMatrix.set_dense_matrix_long_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4843 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double = {"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double};
4844 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4845  PyObject *__pyx_r = 0;
4846  __Pyx_RefNannyDeclarations
4847  __Pyx_RefNannySetupContext("set_dense_matrix_long_double (wrapper)", 0);
4848  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4849 
4850  /* function exit code */
4851  __Pyx_RefNannyFinishContext();
4852  return __pyx_r;
4853 }
4854 
4855 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4856  LongIndexType __pyx_v_A_num_rows;
4857  LongIndexType __pyx_v_A_num_columns;
4858  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4859  __Pyx_memviewslice __pyx_v_A_data_long_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4860  __Pyx_memviewslice __pyx_v_A_data_long_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4861  long double *__pyx_v_A_data_long_double;
4862  PyObject *__pyx_r = NULL;
4863  __Pyx_TraceDeclarations
4864  __Pyx_RefNannyDeclarations
4865  PyObject *__pyx_t_1 = NULL;
4866  PyObject *__pyx_t_2 = NULL;
4867  LongIndexType __pyx_t_3;
4868  int __pyx_t_4;
4869  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4870  Py_ssize_t __pyx_t_6;
4871  Py_ssize_t __pyx_t_7;
4872  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4873  cDenseMatrix<long double> *__pyx_t_9;
4874  int __pyx_lineno = 0;
4875  const char *__pyx_filename = NULL;
4876  int __pyx_clineno = 0;
4877  __Pyx_TraceFrameInit(__pyx_codeobj__7)
4878  __Pyx_RefNannySetupContext("set_dense_matrix_long_double", 0);
4879  __Pyx_TraceCall("set_dense_matrix_long_double", __pyx_f[0], 328, 0, __PYX_ERR(0, 328, __pyx_L1_error));
4880 
4881  /* "imate/_c_linear_operator/py_c_matrix.pyx":337
4882  *
4883  * # Matrix size
4884  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4885  * cdef LongIndexType A_num_columns = A.shape[1]
4886  *
4887  */
4888  __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
4889  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
4890  __Pyx_GOTREF(__pyx_t_1);
4891  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
4892  __Pyx_GOTREF(__pyx_t_2);
4893  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4894  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
4895  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4896  __pyx_v_A_num_rows = __pyx_t_3;
4897 
4898  /* "imate/_c_linear_operator/py_c_matrix.pyx":338
4899  * # Matrix size
4900  * cdef LongIndexType A_num_rows = A.shape[0]
4901  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4902  *
4903  * # Contiguity
4904  */
4905  __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
4906  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
4907  __Pyx_GOTREF(__pyx_t_2);
4908  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
4909  __Pyx_GOTREF(__pyx_t_1);
4910  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4911  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
4912  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4913  __pyx_v_A_num_columns = __pyx_t_3;
4914 
4915  /* "imate/_c_linear_operator/py_c_matrix.pyx":342
4916  * # Contiguity
4917  * cdef FlagType A_is_row_major
4918  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4919  * A_is_row_major = 1
4920  * elif A.flags['F_CONTIGUOUS']:
4921  */
4922  __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
4923  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
4924  __Pyx_GOTREF(__pyx_t_1);
4925  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
4926  __Pyx_GOTREF(__pyx_t_2);
4927  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4928  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
4929  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4930  if (__pyx_t_4) {
4931 
4932  /* "imate/_c_linear_operator/py_c_matrix.pyx":343
4933  * cdef FlagType A_is_row_major
4934  * if A.flags['C_CONTIGUOUS']:
4935  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4936  * elif A.flags['F_CONTIGUOUS']:
4937  * A_is_row_major = 0
4938  */
4939  __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
4940  __pyx_v_A_is_row_major = 1;
4941 
4942  /* "imate/_c_linear_operator/py_c_matrix.pyx":342
4943  * # Contiguity
4944  * cdef FlagType A_is_row_major
4945  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4946  * A_is_row_major = 1
4947  * elif A.flags['F_CONTIGUOUS']:
4948  */
4949  goto __pyx_L3;
4950  }
4951 
4952  /* "imate/_c_linear_operator/py_c_matrix.pyx":344
4953  * if A.flags['C_CONTIGUOUS']:
4954  * A_is_row_major = 1
4955  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4956  * A_is_row_major = 0
4957  * else:
4958  */
4959  __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error))
4960  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
4961  __Pyx_GOTREF(__pyx_t_2);
4962  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
4963  __Pyx_GOTREF(__pyx_t_1);
4964  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4965  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
4966  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4967  if (likely(__pyx_t_4)) {
4968 
4969  /* "imate/_c_linear_operator/py_c_matrix.pyx":345
4970  * A_is_row_major = 1
4971  * elif A.flags['F_CONTIGUOUS']:
4972  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4973  * else:
4974  * raise TypeError('Matrix A should be either C or F contiguous.')
4975  */
4976  __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
4977  __pyx_v_A_is_row_major = 0;
4978 
4979  /* "imate/_c_linear_operator/py_c_matrix.pyx":344
4980  * if A.flags['C_CONTIGUOUS']:
4981  * A_is_row_major = 1
4982  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4983  * A_is_row_major = 0
4984  * else:
4985  */
4986  goto __pyx_L3;
4987  }
4988 
4989  /* "imate/_c_linear_operator/py_c_matrix.pyx":347
4990  * A_is_row_major = 0
4991  * else:
4992  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4993  *
4994  * # Declare memoryviews to get data pointer
4995  */
4996  __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
4997  /*else*/ {
4998  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
4999  __Pyx_GOTREF(__pyx_t_1);
5000  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5001  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5002  __PYX_ERR(0, 347, __pyx_L1_error)
5003  }
5004  __pyx_L3:;
5005 
5006  /* "imate/_c_linear_operator/py_c_matrix.pyx":357
5007  *
5008  * # Get pointer to data of A depending on row or column major
5009  * if A_is_row_major: # <<<<<<<<<<<<<<
5010  *
5011  * # Memoryview of A for row major matrix
5012  */
5013  __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
5014  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
5015  if (__pyx_t_4) {
5016 
5017  /* "imate/_c_linear_operator/py_c_matrix.pyx":360
5018  *
5019  * # Memoryview of A for row major matrix
5020  * A_data_long_double_mv_c = A # <<<<<<<<<<<<<<
5021  *
5022  * # Pointer of the data of A
5023  */
5024  __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
5025  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 360, __pyx_L1_error)
5026  __pyx_v_A_data_long_double_mv_c = __pyx_t_5;
5027  __pyx_t_5.memview = NULL;
5028  __pyx_t_5.data = NULL;
5029 
5030  /* "imate/_c_linear_operator/py_c_matrix.pyx":363
5031  *
5032  * # Pointer of the data of A
5033  * A_data_long_double = &A_data_long_double_mv_c[0, 0] # <<<<<<<<<<<<<<
5034  *
5035  * else:
5036  */
5037  __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
5038  __pyx_t_6 = 0;
5039  __pyx_t_7 = 0;
5040  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_long_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
5041 
5042  /* "imate/_c_linear_operator/py_c_matrix.pyx":357
5043  *
5044  * # Get pointer to data of A depending on row or column major
5045  * if A_is_row_major: # <<<<<<<<<<<<<<
5046  *
5047  * # Memoryview of A for row major matrix
5048  */
5049  goto __pyx_L4;
5050  }
5051 
5052  /* "imate/_c_linear_operator/py_c_matrix.pyx":368
5053  *
5054  * # Memoryview of A for column major matrix
5055  * A_data_long_double_mv_f = A # <<<<<<<<<<<<<<
5056  *
5057  * # Pointer of the data of A
5058  */
5059  __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
5060  /*else*/ {
5061  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
5062  __pyx_v_A_data_long_double_mv_f = __pyx_t_8;
5063  __pyx_t_8.memview = NULL;
5064  __pyx_t_8.data = NULL;
5065 
5066  /* "imate/_c_linear_operator/py_c_matrix.pyx":371
5067  *
5068  * # Pointer of the data of A
5069  * A_data_long_double = &A_data_long_double_mv_f[0, 0] # <<<<<<<<<<<<<<
5070  *
5071  * # Create a linear operator object
5072  */
5073  __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error))
5074  __pyx_t_7 = 0;
5075  __pyx_t_6 = 0;
5076  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_A_data_long_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_long_double_mv_f.strides[1]) ))));
5077  }
5078  __pyx_L4:;
5079 
5080  /* "imate/_c_linear_operator/py_c_matrix.pyx":374
5081  *
5082  * # Create a linear operator object
5083  * self.Aop_long_double = new cDenseMatrix[long double]( # <<<<<<<<<<<<<<
5084  * A_data_long_double,
5085  * A_num_rows,
5086  */
5087  __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
5088  try {
5089  __pyx_t_9 = new cDenseMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
5090  } catch(...) {
5091  __Pyx_CppExn2PyErr();
5092  __PYX_ERR(0, 374, __pyx_L1_error)
5093  }
5094  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5095 
5096  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
5097  * # ============================
5098  *
5099  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5100  * """
5101  * Sets matrix A.
5102  */
5103 
5104  /* function exit code */
5105  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5106  goto __pyx_L0;
5107  __pyx_L1_error:;
5108  __Pyx_XDECREF(__pyx_t_1);
5109  __Pyx_XDECREF(__pyx_t_2);
5110  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5111  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5112  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5113  __pyx_r = NULL;
5114  __pyx_L0:;
5115  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_c, 1);
5116  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_f, 1);
5117  __Pyx_XGIVEREF(__pyx_r);
5118  __Pyx_TraceReturn(__pyx_r, 0);
5119  __Pyx_RefNannyFinishContext();
5120  return __pyx_r;
5121 }
5122 
5123 /* "imate/_c_linear_operator/py_c_matrix.pyx":384
5124  * # ====================
5125  *
5126  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
5127  * """
5128  * """
5129  */
5130 
5131 /* Python wrapper */
5132 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5133 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float[] = "pycMatrix.set_csr_matrix_float(self, A)\n\n ";
5134 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float = {"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float};
5135 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5136  PyObject *__pyx_r = 0;
5137  __Pyx_RefNannyDeclarations
5138  __Pyx_RefNannySetupContext("set_csr_matrix_float (wrapper)", 0);
5139  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5140 
5141  /* function exit code */
5142  __Pyx_RefNannyFinishContext();
5143  return __pyx_r;
5144 }
5145 
5146 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5147  LongIndexType __pyx_v_A_num_rows;
5148  LongIndexType __pyx_v_A_num_columns;
5149  __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5150  float *__pyx_v_A_data_float;
5151  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5152  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5153  LongIndexType *__pyx_v_A_indices;
5154  LongIndexType *__pyx_v_A_index_pointer;
5155  PyObject *__pyx_r = NULL;
5156  __Pyx_TraceDeclarations
5157  __Pyx_RefNannyDeclarations
5158  PyObject *__pyx_t_1 = NULL;
5159  PyObject *__pyx_t_2 = NULL;
5160  LongIndexType __pyx_t_3;
5161  PyObject *__pyx_t_4 = NULL;
5162  PyObject *__pyx_t_5 = NULL;
5163  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5164  Py_ssize_t __pyx_t_7;
5165  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5166  cCSRMatrix<float> *__pyx_t_9;
5167  int __pyx_lineno = 0;
5168  const char *__pyx_filename = NULL;
5169  int __pyx_clineno = 0;
5170  __Pyx_TraceFrameInit(__pyx_codeobj__8)
5171  __Pyx_RefNannySetupContext("set_csr_matrix_float", 0);
5172  __Pyx_TraceCall("set_csr_matrix_float", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
5173 
5174  /* "imate/_c_linear_operator/py_c_matrix.pyx":389
5175  *
5176  * # Matrix size
5177  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5178  * cdef LongIndexType A_num_columns = A.shape[1]
5179  *
5180  */
5181  __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
5182  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
5183  __Pyx_GOTREF(__pyx_t_1);
5184  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
5185  __Pyx_GOTREF(__pyx_t_2);
5186  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5187  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
5188  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5189  __pyx_v_A_num_rows = __pyx_t_3;
5190 
5191  /* "imate/_c_linear_operator/py_c_matrix.pyx":390
5192  * # Matrix size
5193  * cdef LongIndexType A_num_rows = A.shape[0]
5194  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5195  *
5196  * # Declare memoryviews to get pointer of A.data
5197  */
5198  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5199  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
5200  __Pyx_GOTREF(__pyx_t_2);
5201  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
5202  __Pyx_GOTREF(__pyx_t_1);
5203  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5204  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
5205  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5206  __pyx_v_A_num_columns = __pyx_t_3;
5207 
5208  /* "imate/_c_linear_operator/py_c_matrix.pyx":400
5209  * # If the input type is the same as LongIndexType, no copy is performed.
5210  * self.A_indices_copy = \
5211  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5212  * self.A_index_pointer_copy = \
5213  * A.indptr.astype(self.long_index_type_name, copy=False)
5214  */
5215  __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5216  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5217  __Pyx_GOTREF(__pyx_t_1);
5218  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
5219  __Pyx_GOTREF(__pyx_t_2);
5220  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5221  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5222  __Pyx_GOTREF(__pyx_t_1);
5223  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
5224  __Pyx_GOTREF(__pyx_t_4);
5225  __Pyx_GIVEREF(__pyx_t_1);
5226  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5227  __pyx_t_1 = 0;
5228  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5229  __Pyx_GOTREF(__pyx_t_1);
5230  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
5231  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
5232  __Pyx_GOTREF(__pyx_t_5);
5233  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5234  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5235  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5236 
5237  /* "imate/_c_linear_operator/py_c_matrix.pyx":399
5238  *
5239  * # If the input type is the same as LongIndexType, no copy is performed.
5240  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5241  * A.indices.astype(self.long_index_type_name, copy=False)
5242  * self.A_index_pointer_copy = \
5243  */
5244  __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5245  __Pyx_GIVEREF(__pyx_t_5);
5246  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5247  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5248  __pyx_v_self->A_indices_copy = __pyx_t_5;
5249  __pyx_t_5 = 0;
5250 
5251  /* "imate/_c_linear_operator/py_c_matrix.pyx":402
5252  * A.indices.astype(self.long_index_type_name, copy=False)
5253  * self.A_index_pointer_copy = \
5254  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5255  *
5256  * # Declare memoryviews to get pointer of A.indices and A.indptr
5257  */
5258  __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5259  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5260  __Pyx_GOTREF(__pyx_t_5);
5261  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5262  __Pyx_GOTREF(__pyx_t_1);
5263  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5264  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5265  __Pyx_GOTREF(__pyx_t_5);
5266  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
5267  __Pyx_GOTREF(__pyx_t_4);
5268  __Pyx_GIVEREF(__pyx_t_5);
5269  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5270  __pyx_t_5 = 0;
5271  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5272  __Pyx_GOTREF(__pyx_t_5);
5273  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
5274  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
5275  __Pyx_GOTREF(__pyx_t_2);
5276  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5277  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5278  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5279 
5280  /* "imate/_c_linear_operator/py_c_matrix.pyx":401
5281  * self.A_indices_copy = \
5282  * A.indices.astype(self.long_index_type_name, copy=False)
5283  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5284  * A.indptr.astype(self.long_index_type_name, copy=False)
5285  *
5286  */
5287  __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
5288  __Pyx_GIVEREF(__pyx_t_2);
5289  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5290  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5291  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5292  __pyx_t_2 = 0;
5293 
5294  /* "imate/_c_linear_operator/py_c_matrix.pyx":405
5295  *
5296  * # Declare memoryviews to get pointer of A.indices and A.indptr
5297  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5298  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5299  * self.A_index_pointer_copy
5300  */
5301  __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error))
5302  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
5303  __pyx_v_A_indices_mv = __pyx_t_6;
5304  __pyx_t_6.memview = NULL;
5305  __pyx_t_6.data = NULL;
5306 
5307  /* "imate/_c_linear_operator/py_c_matrix.pyx":407
5308  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5309  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5310  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5311  *
5312  * # Declare pointers to A.indices ans A.indptr
5313  */
5314  __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5315  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
5316  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5317  __pyx_t_6.memview = NULL;
5318  __pyx_t_6.data = NULL;
5319 
5320  /* "imate/_c_linear_operator/py_c_matrix.pyx":410
5321  *
5322  * # Declare pointers to A.indices ans A.indptr
5323  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5324  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5325  *
5326  */
5327  __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5328  __pyx_t_7 = 0;
5329  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5330 
5331  /* "imate/_c_linear_operator/py_c_matrix.pyx":411
5332  * # Declare pointers to A.indices ans A.indptr
5333  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5334  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5335  *
5336  * # Memoryview of A data
5337  */
5338  __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5339  __pyx_t_7 = 0;
5340  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5341 
5342  /* "imate/_c_linear_operator/py_c_matrix.pyx":414
5343  *
5344  * # Memoryview of A data
5345  * A_data_float_mv = A.data # <<<<<<<<<<<<<<
5346  *
5347  * # Get pointers
5348  */
5349  __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
5350  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
5351  __Pyx_GOTREF(__pyx_t_2);
5352  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 414, __pyx_L1_error)
5353  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5354  __pyx_v_A_data_float_mv = __pyx_t_8;
5355  __pyx_t_8.memview = NULL;
5356  __pyx_t_8.data = NULL;
5357 
5358  /* "imate/_c_linear_operator/py_c_matrix.pyx":417
5359  *
5360  * # Get pointers
5361  * A_data_float = &A_data_float_mv[0] # <<<<<<<<<<<<<<
5362  *
5363  * # Create a linear operator object
5364  */
5365  __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error))
5366  __pyx_t_7 = 0;
5367  __pyx_v_A_data_float = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
5368 
5369  /* "imate/_c_linear_operator/py_c_matrix.pyx":420
5370  *
5371  * # Create a linear operator object
5372  * self.Aop_float = new cCSRMatrix[float]( # <<<<<<<<<<<<<<
5373  * A_data_float,
5374  * A_indices,
5375  */
5376  __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5377  try {
5378  __pyx_t_9 = new cCSRMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5379  } catch(...) {
5380  __Pyx_CppExn2PyErr();
5381  __PYX_ERR(0, 420, __pyx_L1_error)
5382  }
5383  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
5384 
5385  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
5386  * # ====================
5387  *
5388  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
5389  * """
5390  * """
5391  */
5392 
5393  /* function exit code */
5394  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5395  goto __pyx_L0;
5396  __pyx_L1_error:;
5397  __Pyx_XDECREF(__pyx_t_1);
5398  __Pyx_XDECREF(__pyx_t_2);
5399  __Pyx_XDECREF(__pyx_t_4);
5400  __Pyx_XDECREF(__pyx_t_5);
5401  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5402  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5403  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5404  __pyx_r = NULL;
5405  __pyx_L0:;
5406  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
5407  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5408  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5409  __Pyx_XGIVEREF(__pyx_r);
5410  __Pyx_TraceReturn(__pyx_r, 0);
5411  __Pyx_RefNannyFinishContext();
5412  return __pyx_r;
5413 }
5414 
5415 /* "imate/_c_linear_operator/py_c_matrix.pyx":431
5416  * # =====================
5417  *
5418  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
5419  * """
5420  * """
5421  */
5422 
5423 /* Python wrapper */
5424 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5425 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double[] = "pycMatrix.set_csr_matrix_double(self, A)\n\n ";
5426 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double = {"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double};
5427 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5428  PyObject *__pyx_r = 0;
5429  __Pyx_RefNannyDeclarations
5430  __Pyx_RefNannySetupContext("set_csr_matrix_double (wrapper)", 0);
5431  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5432 
5433  /* function exit code */
5434  __Pyx_RefNannyFinishContext();
5435  return __pyx_r;
5436 }
5437 
5438 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5439  LongIndexType __pyx_v_A_num_rows;
5440  LongIndexType __pyx_v_A_num_columns;
5441  __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5442  double *__pyx_v_A_data_double;
5443  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5444  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5445  LongIndexType *__pyx_v_A_indices;
5446  LongIndexType *__pyx_v_A_index_pointer;
5447  PyObject *__pyx_r = NULL;
5448  __Pyx_TraceDeclarations
5449  __Pyx_RefNannyDeclarations
5450  PyObject *__pyx_t_1 = NULL;
5451  PyObject *__pyx_t_2 = NULL;
5452  LongIndexType __pyx_t_3;
5453  PyObject *__pyx_t_4 = NULL;
5454  PyObject *__pyx_t_5 = NULL;
5455  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5456  Py_ssize_t __pyx_t_7;
5457  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5458  cCSRMatrix<double> *__pyx_t_9;
5459  int __pyx_lineno = 0;
5460  const char *__pyx_filename = NULL;
5461  int __pyx_clineno = 0;
5462  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5463  __Pyx_RefNannySetupContext("set_csr_matrix_double", 0);
5464  __Pyx_TraceCall("set_csr_matrix_double", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error));
5465 
5466  /* "imate/_c_linear_operator/py_c_matrix.pyx":436
5467  *
5468  * # Matrix size
5469  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5470  * cdef LongIndexType A_num_columns = A.shape[1]
5471  *
5472  */
5473  __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5474  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
5475  __Pyx_GOTREF(__pyx_t_1);
5476  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
5477  __Pyx_GOTREF(__pyx_t_2);
5478  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5479  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
5480  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5481  __pyx_v_A_num_rows = __pyx_t_3;
5482 
5483  /* "imate/_c_linear_operator/py_c_matrix.pyx":437
5484  * # Matrix size
5485  * cdef LongIndexType A_num_rows = A.shape[0]
5486  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5487  *
5488  * # Declare memoryviews to get pointer of A.data
5489  */
5490  __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
5491  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
5492  __Pyx_GOTREF(__pyx_t_2);
5493  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
5494  __Pyx_GOTREF(__pyx_t_1);
5495  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5496  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
5497  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5498  __pyx_v_A_num_columns = __pyx_t_3;
5499 
5500  /* "imate/_c_linear_operator/py_c_matrix.pyx":447
5501  * # If the input type is the same as LongIndexType, no copy is performed.
5502  * self.A_indices_copy = \
5503  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5504  * self.A_index_pointer_copy = \
5505  * A.indptr.astype(self.long_index_type_name, copy=False)
5506  */
5507  __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5508  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5509  __Pyx_GOTREF(__pyx_t_1);
5510  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
5511  __Pyx_GOTREF(__pyx_t_2);
5512  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5513  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5514  __Pyx_GOTREF(__pyx_t_1);
5515  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
5516  __Pyx_GOTREF(__pyx_t_4);
5517  __Pyx_GIVEREF(__pyx_t_1);
5518  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5519  __pyx_t_1 = 0;
5520  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5521  __Pyx_GOTREF(__pyx_t_1);
5522  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
5523  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
5524  __Pyx_GOTREF(__pyx_t_5);
5525  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5526  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5527  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5528 
5529  /* "imate/_c_linear_operator/py_c_matrix.pyx":446
5530  *
5531  * # If the input type is the same as LongIndexType, no copy is performed.
5532  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5533  * A.indices.astype(self.long_index_type_name, copy=False)
5534  * self.A_index_pointer_copy = \
5535  */
5536  __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5537  __Pyx_GIVEREF(__pyx_t_5);
5538  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5539  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5540  __pyx_v_self->A_indices_copy = __pyx_t_5;
5541  __pyx_t_5 = 0;
5542 
5543  /* "imate/_c_linear_operator/py_c_matrix.pyx":449
5544  * A.indices.astype(self.long_index_type_name, copy=False)
5545  * self.A_index_pointer_copy = \
5546  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5547  *
5548  * # Declare memoryviews to get pointer of A.indices and A.indptr
5549  */
5550  __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5551  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5552  __Pyx_GOTREF(__pyx_t_5);
5553  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
5554  __Pyx_GOTREF(__pyx_t_1);
5555  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5556  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5557  __Pyx_GOTREF(__pyx_t_5);
5558  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
5559  __Pyx_GOTREF(__pyx_t_4);
5560  __Pyx_GIVEREF(__pyx_t_5);
5561  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5562  __pyx_t_5 = 0;
5563  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5564  __Pyx_GOTREF(__pyx_t_5);
5565  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
5566  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
5567  __Pyx_GOTREF(__pyx_t_2);
5568  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5569  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5570  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5571 
5572  /* "imate/_c_linear_operator/py_c_matrix.pyx":448
5573  * self.A_indices_copy = \
5574  * A.indices.astype(self.long_index_type_name, copy=False)
5575  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5576  * A.indptr.astype(self.long_index_type_name, copy=False)
5577  *
5578  */
5579  __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5580  __Pyx_GIVEREF(__pyx_t_2);
5581  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5582  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5583  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5584  __pyx_t_2 = 0;
5585 
5586  /* "imate/_c_linear_operator/py_c_matrix.pyx":452
5587  *
5588  * # Declare memoryviews to get pointer of A.indices and A.indptr
5589  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5590  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5591  * self.A_index_pointer_copy
5592  */
5593  __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5594  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
5595  __pyx_v_A_indices_mv = __pyx_t_6;
5596  __pyx_t_6.memview = NULL;
5597  __pyx_t_6.data = NULL;
5598 
5599  /* "imate/_c_linear_operator/py_c_matrix.pyx":454
5600  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5601  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5602  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5603  *
5604  * # Declare pointers to A.indices ans A.indptr
5605  */
5606  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5607  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 454, __pyx_L1_error)
5608  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5609  __pyx_t_6.memview = NULL;
5610  __pyx_t_6.data = NULL;
5611 
5612  /* "imate/_c_linear_operator/py_c_matrix.pyx":457
5613  *
5614  * # Declare pointers to A.indices ans A.indptr
5615  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5616  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5617  *
5618  */
5619  __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5620  __pyx_t_7 = 0;
5621  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5622 
5623  /* "imate/_c_linear_operator/py_c_matrix.pyx":458
5624  * # Declare pointers to A.indices ans A.indptr
5625  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5626  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5627  *
5628  * # Memoryview of A data
5629  */
5630  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5631  __pyx_t_7 = 0;
5632  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5633 
5634  /* "imate/_c_linear_operator/py_c_matrix.pyx":461
5635  *
5636  * # Memoryview of A data
5637  * A_data_double_mv = A.data # <<<<<<<<<<<<<<
5638  *
5639  * # Get pointers
5640  */
5641  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
5642  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
5643  __Pyx_GOTREF(__pyx_t_2);
5644  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
5645  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5646  __pyx_v_A_data_double_mv = __pyx_t_8;
5647  __pyx_t_8.memview = NULL;
5648  __pyx_t_8.data = NULL;
5649 
5650  /* "imate/_c_linear_operator/py_c_matrix.pyx":464
5651  *
5652  * # Get pointers
5653  * A_data_double = &A_data_double_mv[0] # <<<<<<<<<<<<<<
5654  *
5655  * # Create a linear operator object
5656  */
5657  __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5658  __pyx_t_7 = 0;
5659  __pyx_v_A_data_double = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
5660 
5661  /* "imate/_c_linear_operator/py_c_matrix.pyx":467
5662  *
5663  * # Create a linear operator object
5664  * self.Aop_double = new cCSRMatrix[double]( # <<<<<<<<<<<<<<
5665  * A_data_double,
5666  * A_indices,
5667  */
5668  __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
5669  try {
5670  __pyx_t_9 = new cCSRMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5671  } catch(...) {
5672  __Pyx_CppExn2PyErr();
5673  __PYX_ERR(0, 467, __pyx_L1_error)
5674  }
5675  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
5676 
5677  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
5678  * # =====================
5679  *
5680  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
5681  * """
5682  * """
5683  */
5684 
5685  /* function exit code */
5686  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5687  goto __pyx_L0;
5688  __pyx_L1_error:;
5689  __Pyx_XDECREF(__pyx_t_1);
5690  __Pyx_XDECREF(__pyx_t_2);
5691  __Pyx_XDECREF(__pyx_t_4);
5692  __Pyx_XDECREF(__pyx_t_5);
5693  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5694  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5695  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5696  __pyx_r = NULL;
5697  __pyx_L0:;
5698  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
5699  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5700  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5701  __Pyx_XGIVEREF(__pyx_r);
5702  __Pyx_TraceReturn(__pyx_r, 0);
5703  __Pyx_RefNannyFinishContext();
5704  return __pyx_r;
5705 }
5706 
5707 /* "imate/_c_linear_operator/py_c_matrix.pyx":478
5708  * # ==========================
5709  *
5710  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5711  * """
5712  * """
5713  */
5714 
5715 /* Python wrapper */
5716 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5717 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double[] = "pycMatrix.set_csr_matrix_long_double(self, A)\n\n ";
5718 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double = {"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double};
5719 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5720  PyObject *__pyx_r = 0;
5721  __Pyx_RefNannyDeclarations
5722  __Pyx_RefNannySetupContext("set_csr_matrix_long_double (wrapper)", 0);
5723  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5724 
5725  /* function exit code */
5726  __Pyx_RefNannyFinishContext();
5727  return __pyx_r;
5728 }
5729 
5730 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5731  LongIndexType __pyx_v_A_num_rows;
5732  LongIndexType __pyx_v_A_num_columns;
5733  __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5734  long double *__pyx_v_A_data_long_double;
5735  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5736  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5737  LongIndexType *__pyx_v_A_indices;
5738  LongIndexType *__pyx_v_A_index_pointer;
5739  PyObject *__pyx_r = NULL;
5740  __Pyx_TraceDeclarations
5741  __Pyx_RefNannyDeclarations
5742  PyObject *__pyx_t_1 = NULL;
5743  PyObject *__pyx_t_2 = NULL;
5744  LongIndexType __pyx_t_3;
5745  PyObject *__pyx_t_4 = NULL;
5746  PyObject *__pyx_t_5 = NULL;
5747  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5748  Py_ssize_t __pyx_t_7;
5749  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5750  cCSRMatrix<long double> *__pyx_t_9;
5751  int __pyx_lineno = 0;
5752  const char *__pyx_filename = NULL;
5753  int __pyx_clineno = 0;
5754  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5755  __Pyx_RefNannySetupContext("set_csr_matrix_long_double", 0);
5756  __Pyx_TraceCall("set_csr_matrix_long_double", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
5757 
5758  /* "imate/_c_linear_operator/py_c_matrix.pyx":483
5759  *
5760  * # Matrix size
5761  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5762  * cdef LongIndexType A_num_columns = A.shape[1]
5763  *
5764  */
5765  __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
5766  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
5767  __Pyx_GOTREF(__pyx_t_1);
5768  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
5769  __Pyx_GOTREF(__pyx_t_2);
5770  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5771  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
5772  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5773  __pyx_v_A_num_rows = __pyx_t_3;
5774 
5775  /* "imate/_c_linear_operator/py_c_matrix.pyx":484
5776  * # Matrix size
5777  * cdef LongIndexType A_num_rows = A.shape[0]
5778  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5779  *
5780  * # Declare memoryviews to get pointer of A.data
5781  */
5782  __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error))
5783  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
5784  __Pyx_GOTREF(__pyx_t_2);
5785  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
5786  __Pyx_GOTREF(__pyx_t_1);
5787  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5788  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
5789  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5790  __pyx_v_A_num_columns = __pyx_t_3;
5791 
5792  /* "imate/_c_linear_operator/py_c_matrix.pyx":494
5793  * # If the input type is the same as LongIndexType, no copy is performed.
5794  * self.A_indices_copy = \
5795  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5796  * self.A_index_pointer_copy = \
5797  * A.indptr.astype(self.long_index_type_name, copy=False)
5798  */
5799  __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error))
5800  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5801  __Pyx_GOTREF(__pyx_t_1);
5802  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
5803  __Pyx_GOTREF(__pyx_t_2);
5804  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5805  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5806  __Pyx_GOTREF(__pyx_t_1);
5807  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
5808  __Pyx_GOTREF(__pyx_t_4);
5809  __Pyx_GIVEREF(__pyx_t_1);
5810  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5811  __pyx_t_1 = 0;
5812  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5813  __Pyx_GOTREF(__pyx_t_1);
5814  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
5815  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
5816  __Pyx_GOTREF(__pyx_t_5);
5817  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5818  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5819  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5820 
5821  /* "imate/_c_linear_operator/py_c_matrix.pyx":493
5822  *
5823  * # If the input type is the same as LongIndexType, no copy is performed.
5824  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5825  * A.indices.astype(self.long_index_type_name, copy=False)
5826  * self.A_index_pointer_copy = \
5827  */
5828  __Pyx_TraceLine(493,0,__PYX_ERR(0, 493, __pyx_L1_error))
5829  __Pyx_GIVEREF(__pyx_t_5);
5830  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5831  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5832  __pyx_v_self->A_indices_copy = __pyx_t_5;
5833  __pyx_t_5 = 0;
5834 
5835  /* "imate/_c_linear_operator/py_c_matrix.pyx":496
5836  * A.indices.astype(self.long_index_type_name, copy=False)
5837  * self.A_index_pointer_copy = \
5838  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5839  *
5840  * # Declare memoryviews to get pointer of A.indices and A.indptr
5841  */
5842  __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
5843  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5844  __Pyx_GOTREF(__pyx_t_5);
5845  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
5846  __Pyx_GOTREF(__pyx_t_1);
5847  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5848  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5849  __Pyx_GOTREF(__pyx_t_5);
5850  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
5851  __Pyx_GOTREF(__pyx_t_4);
5852  __Pyx_GIVEREF(__pyx_t_5);
5853  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5854  __pyx_t_5 = 0;
5855  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5856  __Pyx_GOTREF(__pyx_t_5);
5857  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
5858  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
5859  __Pyx_GOTREF(__pyx_t_2);
5860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5861  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5862  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5863 
5864  /* "imate/_c_linear_operator/py_c_matrix.pyx":495
5865  * self.A_indices_copy = \
5866  * A.indices.astype(self.long_index_type_name, copy=False)
5867  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5868  * A.indptr.astype(self.long_index_type_name, copy=False)
5869  *
5870  */
5871  __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
5872  __Pyx_GIVEREF(__pyx_t_2);
5873  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5874  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5875  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5876  __pyx_t_2 = 0;
5877 
5878  /* "imate/_c_linear_operator/py_c_matrix.pyx":499
5879  *
5880  * # Declare memoryviews to get pointer of A.indices and A.indptr
5881  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5882  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5883  * self.A_index_pointer_copy
5884  */
5885  __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
5886  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
5887  __pyx_v_A_indices_mv = __pyx_t_6;
5888  __pyx_t_6.memview = NULL;
5889  __pyx_t_6.data = NULL;
5890 
5891  /* "imate/_c_linear_operator/py_c_matrix.pyx":501
5892  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5893  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5894  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5895  *
5896  * # Declare pointers to A.indices ans A.indptr
5897  */
5898  __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
5899  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
5900  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5901  __pyx_t_6.memview = NULL;
5902  __pyx_t_6.data = NULL;
5903 
5904  /* "imate/_c_linear_operator/py_c_matrix.pyx":504
5905  *
5906  * # Declare pointers to A.indices ans A.indptr
5907  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5908  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5909  *
5910  */
5911  __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
5912  __pyx_t_7 = 0;
5913  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5914 
5915  /* "imate/_c_linear_operator/py_c_matrix.pyx":505
5916  * # Declare pointers to A.indices ans A.indptr
5917  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5918  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5919  *
5920  * # Memoryview of A data
5921  */
5922  __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
5923  __pyx_t_7 = 0;
5924  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5925 
5926  /* "imate/_c_linear_operator/py_c_matrix.pyx":508
5927  *
5928  * # Memoryview of A data
5929  * A_data_long_double_mv = A.data # <<<<<<<<<<<<<<
5930  *
5931  * # Get pointers
5932  */
5933  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
5934  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
5935  __Pyx_GOTREF(__pyx_t_2);
5936  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
5937  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5938  __pyx_v_A_data_long_double_mv = __pyx_t_8;
5939  __pyx_t_8.memview = NULL;
5940  __pyx_t_8.data = NULL;
5941 
5942  /* "imate/_c_linear_operator/py_c_matrix.pyx":511
5943  *
5944  * # Get pointers
5945  * A_data_long_double = &A_data_long_double_mv[0] # <<<<<<<<<<<<<<
5946  *
5947  * # Create a linear operator object
5948  */
5949  __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
5950  __pyx_t_7 = 0;
5951  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
5952 
5953  /* "imate/_c_linear_operator/py_c_matrix.pyx":514
5954  *
5955  * # Create a linear operator object
5956  * self.Aop_long_double = new cCSRMatrix[long double]( # <<<<<<<<<<<<<<
5957  * A_data_long_double,
5958  * A_indices,
5959  */
5960  __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
5961  try {
5962  __pyx_t_9 = new cCSRMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5963  } catch(...) {
5964  __Pyx_CppExn2PyErr();
5965  __PYX_ERR(0, 514, __pyx_L1_error)
5966  }
5967  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5968 
5969  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
5970  * # ==========================
5971  *
5972  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5973  * """
5974  * """
5975  */
5976 
5977  /* function exit code */
5978  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5979  goto __pyx_L0;
5980  __pyx_L1_error:;
5981  __Pyx_XDECREF(__pyx_t_1);
5982  __Pyx_XDECREF(__pyx_t_2);
5983  __Pyx_XDECREF(__pyx_t_4);
5984  __Pyx_XDECREF(__pyx_t_5);
5985  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5986  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5987  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5988  __pyx_r = NULL;
5989  __pyx_L0:;
5990  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
5991  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5992  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5993  __Pyx_XGIVEREF(__pyx_r);
5994  __Pyx_TraceReturn(__pyx_r, 0);
5995  __Pyx_RefNannyFinishContext();
5996  return __pyx_r;
5997 }
5998 
5999 /* "imate/_c_linear_operator/py_c_matrix.pyx":525
6000  * # ====================
6001  *
6002  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
6003  * """
6004  * """
6005  */
6006 
6007 /* Python wrapper */
6008 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6009 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float[] = "pycMatrix.set_csc_matrix_float(self, A)\n\n ";
6010 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float = {"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float};
6011 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6012  PyObject *__pyx_r = 0;
6013  __Pyx_RefNannyDeclarations
6014  __Pyx_RefNannySetupContext("set_csc_matrix_float (wrapper)", 0);
6015  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6016 
6017  /* function exit code */
6018  __Pyx_RefNannyFinishContext();
6019  return __pyx_r;
6020 }
6021 
6022 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6023  LongIndexType __pyx_v_A_num_rows;
6024  LongIndexType __pyx_v_A_num_columns;
6025  __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6026  float *__pyx_v_A_data_float;
6027  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6028  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6029  LongIndexType *__pyx_v_A_indices;
6030  LongIndexType *__pyx_v_A_index_pointer;
6031  PyObject *__pyx_r = NULL;
6032  __Pyx_TraceDeclarations
6033  __Pyx_RefNannyDeclarations
6034  PyObject *__pyx_t_1 = NULL;
6035  PyObject *__pyx_t_2 = NULL;
6036  LongIndexType __pyx_t_3;
6037  PyObject *__pyx_t_4 = NULL;
6038  PyObject *__pyx_t_5 = NULL;
6039  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6040  Py_ssize_t __pyx_t_7;
6041  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6042  cCSCMatrix<float> *__pyx_t_9;
6043  int __pyx_lineno = 0;
6044  const char *__pyx_filename = NULL;
6045  int __pyx_clineno = 0;
6046  __Pyx_TraceFrameInit(__pyx_codeobj__11)
6047  __Pyx_RefNannySetupContext("set_csc_matrix_float", 0);
6048  __Pyx_TraceCall("set_csc_matrix_float", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
6049 
6050  /* "imate/_c_linear_operator/py_c_matrix.pyx":530
6051  *
6052  * # Matrix size
6053  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6054  * cdef LongIndexType A_num_columns = A.shape[1]
6055  *
6056  */
6057  __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
6058  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
6059  __Pyx_GOTREF(__pyx_t_1);
6060  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
6061  __Pyx_GOTREF(__pyx_t_2);
6062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6063  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
6064  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6065  __pyx_v_A_num_rows = __pyx_t_3;
6066 
6067  /* "imate/_c_linear_operator/py_c_matrix.pyx":531
6068  * # Matrix size
6069  * cdef LongIndexType A_num_rows = A.shape[0]
6070  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6071  *
6072  * # Declare memoryviews to get pointer of A.data
6073  */
6074  __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
6075  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
6076  __Pyx_GOTREF(__pyx_t_2);
6077  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
6078  __Pyx_GOTREF(__pyx_t_1);
6079  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6080  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error)
6081  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6082  __pyx_v_A_num_columns = __pyx_t_3;
6083 
6084  /* "imate/_c_linear_operator/py_c_matrix.pyx":541
6085  * # If the input type is the same as LongIndexType, no copy is performed.
6086  * self.A_indices_copy = \
6087  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6088  * self.A_index_pointer_copy = \
6089  * A.indptr.astype(self.long_index_type_name, copy=False)
6090  */
6091  __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error))
6092  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6093  __Pyx_GOTREF(__pyx_t_1);
6094  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
6095  __Pyx_GOTREF(__pyx_t_2);
6096  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6097  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6098  __Pyx_GOTREF(__pyx_t_1);
6099  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
6100  __Pyx_GOTREF(__pyx_t_4);
6101  __Pyx_GIVEREF(__pyx_t_1);
6102  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6103  __pyx_t_1 = 0;
6104  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6105  __Pyx_GOTREF(__pyx_t_1);
6106  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
6107  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
6108  __Pyx_GOTREF(__pyx_t_5);
6109  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6110  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6111  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6112 
6113  /* "imate/_c_linear_operator/py_c_matrix.pyx":540
6114  *
6115  * # If the input type is the same as LongIndexType, no copy is performed.
6116  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6117  * A.indices.astype(self.long_index_type_name, copy=False)
6118  * self.A_index_pointer_copy = \
6119  */
6120  __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6121  __Pyx_GIVEREF(__pyx_t_5);
6122  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6123  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6124  __pyx_v_self->A_indices_copy = __pyx_t_5;
6125  __pyx_t_5 = 0;
6126 
6127  /* "imate/_c_linear_operator/py_c_matrix.pyx":543
6128  * A.indices.astype(self.long_index_type_name, copy=False)
6129  * self.A_index_pointer_copy = \
6130  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6131  *
6132  * # Declare memoryviews to get pointer of A.indices and A.indptr
6133  */
6134  __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6135  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6136  __Pyx_GOTREF(__pyx_t_5);
6137  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
6138  __Pyx_GOTREF(__pyx_t_1);
6139  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6140  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6141  __Pyx_GOTREF(__pyx_t_5);
6142  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
6143  __Pyx_GOTREF(__pyx_t_4);
6144  __Pyx_GIVEREF(__pyx_t_5);
6145  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6146  __pyx_t_5 = 0;
6147  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6148  __Pyx_GOTREF(__pyx_t_5);
6149  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
6150  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
6151  __Pyx_GOTREF(__pyx_t_2);
6152  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6153  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6154  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6155 
6156  /* "imate/_c_linear_operator/py_c_matrix.pyx":542
6157  * self.A_indices_copy = \
6158  * A.indices.astype(self.long_index_type_name, copy=False)
6159  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6160  * A.indptr.astype(self.long_index_type_name, copy=False)
6161  *
6162  */
6163  __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error))
6164  __Pyx_GIVEREF(__pyx_t_2);
6165  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6166  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6167  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6168  __pyx_t_2 = 0;
6169 
6170  /* "imate/_c_linear_operator/py_c_matrix.pyx":546
6171  *
6172  * # Declare memoryviews to get pointer of A.indices and A.indptr
6173  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6174  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6175  * self.A_index_pointer_copy
6176  */
6177  __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6178  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
6179  __pyx_v_A_indices_mv = __pyx_t_6;
6180  __pyx_t_6.memview = NULL;
6181  __pyx_t_6.data = NULL;
6182 
6183  /* "imate/_c_linear_operator/py_c_matrix.pyx":548
6184  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6185  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6186  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6187  *
6188  * # Declare pointers to A.indices ans A.indptr
6189  */
6190  __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error))
6191  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 548, __pyx_L1_error)
6192  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6193  __pyx_t_6.memview = NULL;
6194  __pyx_t_6.data = NULL;
6195 
6196  /* "imate/_c_linear_operator/py_c_matrix.pyx":551
6197  *
6198  * # Declare pointers to A.indices ans A.indptr
6199  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6200  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6201  *
6202  */
6203  __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6204  __pyx_t_7 = 0;
6205  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6206 
6207  /* "imate/_c_linear_operator/py_c_matrix.pyx":552
6208  * # Declare pointers to A.indices ans A.indptr
6209  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6210  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6211  *
6212  * # Memoryview of A data
6213  */
6214  __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
6215  __pyx_t_7 = 0;
6216  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6217 
6218  /* "imate/_c_linear_operator/py_c_matrix.pyx":555
6219  *
6220  * # Memoryview of A data
6221  * A_data_float_mv = A.data # <<<<<<<<<<<<<<
6222  *
6223  * # Get pointers
6224  */
6225  __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error))
6226  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
6227  __Pyx_GOTREF(__pyx_t_2);
6228  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
6229  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6230  __pyx_v_A_data_float_mv = __pyx_t_8;
6231  __pyx_t_8.memview = NULL;
6232  __pyx_t_8.data = NULL;
6233 
6234  /* "imate/_c_linear_operator/py_c_matrix.pyx":558
6235  *
6236  * # Get pointers
6237  * A_data_float = &A_data_float_mv[0] # <<<<<<<<<<<<<<
6238  *
6239  * # Create a linear operator object
6240  */
6241  __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6242  __pyx_t_7 = 0;
6243  __pyx_v_A_data_float = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
6244 
6245  /* "imate/_c_linear_operator/py_c_matrix.pyx":561
6246  *
6247  * # Create a linear operator object
6248  * self.Aop_float = new cCSCMatrix[float]( # <<<<<<<<<<<<<<
6249  * A_data_float,
6250  * A_indices,
6251  */
6252  __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6253  try {
6254  __pyx_t_9 = new cCSCMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6255  } catch(...) {
6256  __Pyx_CppExn2PyErr();
6257  __PYX_ERR(0, 561, __pyx_L1_error)
6258  }
6259  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
6260 
6261  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
6262  * # ====================
6263  *
6264  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
6265  * """
6266  * """
6267  */
6268 
6269  /* function exit code */
6270  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6271  goto __pyx_L0;
6272  __pyx_L1_error:;
6273  __Pyx_XDECREF(__pyx_t_1);
6274  __Pyx_XDECREF(__pyx_t_2);
6275  __Pyx_XDECREF(__pyx_t_4);
6276  __Pyx_XDECREF(__pyx_t_5);
6277  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6278  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6279  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6280  __pyx_r = NULL;
6281  __pyx_L0:;
6282  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
6283  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6284  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6285  __Pyx_XGIVEREF(__pyx_r);
6286  __Pyx_TraceReturn(__pyx_r, 0);
6287  __Pyx_RefNannyFinishContext();
6288  return __pyx_r;
6289 }
6290 
6291 /* "imate/_c_linear_operator/py_c_matrix.pyx":572
6292  * # =====================
6293  *
6294  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
6295  * """
6296  * """
6297  */
6298 
6299 /* Python wrapper */
6300 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6301 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double[] = "pycMatrix.set_csc_matrix_double(self, A)\n\n ";
6302 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double = {"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double};
6303 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6304  PyObject *__pyx_r = 0;
6305  __Pyx_RefNannyDeclarations
6306  __Pyx_RefNannySetupContext("set_csc_matrix_double (wrapper)", 0);
6307  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6308 
6309  /* function exit code */
6310  __Pyx_RefNannyFinishContext();
6311  return __pyx_r;
6312 }
6313 
6314 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6315  LongIndexType __pyx_v_A_num_rows;
6316  LongIndexType __pyx_v_A_num_columns;
6317  __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6318  double *__pyx_v_A_data_double;
6319  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6320  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6321  LongIndexType *__pyx_v_A_indices;
6322  LongIndexType *__pyx_v_A_index_pointer;
6323  PyObject *__pyx_r = NULL;
6324  __Pyx_TraceDeclarations
6325  __Pyx_RefNannyDeclarations
6326  PyObject *__pyx_t_1 = NULL;
6327  PyObject *__pyx_t_2 = NULL;
6328  LongIndexType __pyx_t_3;
6329  PyObject *__pyx_t_4 = NULL;
6330  PyObject *__pyx_t_5 = NULL;
6331  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6332  Py_ssize_t __pyx_t_7;
6333  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6334  cCSCMatrix<double> *__pyx_t_9;
6335  int __pyx_lineno = 0;
6336  const char *__pyx_filename = NULL;
6337  int __pyx_clineno = 0;
6338  __Pyx_TraceFrameInit(__pyx_codeobj__12)
6339  __Pyx_RefNannySetupContext("set_csc_matrix_double", 0);
6340  __Pyx_TraceCall("set_csc_matrix_double", __pyx_f[0], 572, 0, __PYX_ERR(0, 572, __pyx_L1_error));
6341 
6342  /* "imate/_c_linear_operator/py_c_matrix.pyx":577
6343  *
6344  * # Matrix size
6345  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6346  * cdef LongIndexType A_num_columns = A.shape[1]
6347  *
6348  */
6349  __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error))
6350  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
6351  __Pyx_GOTREF(__pyx_t_1);
6352  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
6353  __Pyx_GOTREF(__pyx_t_2);
6354  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6355  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
6356  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6357  __pyx_v_A_num_rows = __pyx_t_3;
6358 
6359  /* "imate/_c_linear_operator/py_c_matrix.pyx":578
6360  * # Matrix size
6361  * cdef LongIndexType A_num_rows = A.shape[0]
6362  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6363  *
6364  * # Declare memoryviews to get pointer of A.data
6365  */
6366  __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
6367  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
6368  __Pyx_GOTREF(__pyx_t_2);
6369  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
6370  __Pyx_GOTREF(__pyx_t_1);
6371  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6372  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
6373  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6374  __pyx_v_A_num_columns = __pyx_t_3;
6375 
6376  /* "imate/_c_linear_operator/py_c_matrix.pyx":588
6377  * # If the input type is the same as LongIndexType, no copy is performed.
6378  * self.A_indices_copy = \
6379  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6380  * self.A_index_pointer_copy = \
6381  * A.indptr.astype(self.long_index_type_name, copy=False)
6382  */
6383  __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6384  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6385  __Pyx_GOTREF(__pyx_t_1);
6386  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
6387  __Pyx_GOTREF(__pyx_t_2);
6388  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6389  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6390  __Pyx_GOTREF(__pyx_t_1);
6391  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
6392  __Pyx_GOTREF(__pyx_t_4);
6393  __Pyx_GIVEREF(__pyx_t_1);
6394  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6395  __pyx_t_1 = 0;
6396  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6397  __Pyx_GOTREF(__pyx_t_1);
6398  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
6399  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
6400  __Pyx_GOTREF(__pyx_t_5);
6401  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6402  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6403  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6404 
6405  /* "imate/_c_linear_operator/py_c_matrix.pyx":587
6406  *
6407  * # If the input type is the same as LongIndexType, no copy is performed.
6408  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6409  * A.indices.astype(self.long_index_type_name, copy=False)
6410  * self.A_index_pointer_copy = \
6411  */
6412  __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L1_error))
6413  __Pyx_GIVEREF(__pyx_t_5);
6414  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6415  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6416  __pyx_v_self->A_indices_copy = __pyx_t_5;
6417  __pyx_t_5 = 0;
6418 
6419  /* "imate/_c_linear_operator/py_c_matrix.pyx":590
6420  * A.indices.astype(self.long_index_type_name, copy=False)
6421  * self.A_index_pointer_copy = \
6422  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6423  *
6424  * # Declare memoryviews to get pointer of A.indices and A.indptr
6425  */
6426  __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error))
6427  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6428  __Pyx_GOTREF(__pyx_t_5);
6429  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
6430  __Pyx_GOTREF(__pyx_t_1);
6431  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6432  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6433  __Pyx_GOTREF(__pyx_t_5);
6434  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
6435  __Pyx_GOTREF(__pyx_t_4);
6436  __Pyx_GIVEREF(__pyx_t_5);
6437  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6438  __pyx_t_5 = 0;
6439  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6440  __Pyx_GOTREF(__pyx_t_5);
6441  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
6442  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
6443  __Pyx_GOTREF(__pyx_t_2);
6444  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6445  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6446  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6447 
6448  /* "imate/_c_linear_operator/py_c_matrix.pyx":589
6449  * self.A_indices_copy = \
6450  * A.indices.astype(self.long_index_type_name, copy=False)
6451  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6452  * A.indptr.astype(self.long_index_type_name, copy=False)
6453  *
6454  */
6455  __Pyx_TraceLine(589,0,__PYX_ERR(0, 589, __pyx_L1_error))
6456  __Pyx_GIVEREF(__pyx_t_2);
6457  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6458  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6459  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6460  __pyx_t_2 = 0;
6461 
6462  /* "imate/_c_linear_operator/py_c_matrix.pyx":593
6463  *
6464  * # Declare memoryviews to get pointer of A.indices and A.indptr
6465  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6466  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6467  * self.A_index_pointer_copy
6468  */
6469  __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
6470  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 593, __pyx_L1_error)
6471  __pyx_v_A_indices_mv = __pyx_t_6;
6472  __pyx_t_6.memview = NULL;
6473  __pyx_t_6.data = NULL;
6474 
6475  /* "imate/_c_linear_operator/py_c_matrix.pyx":595
6476  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6477  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6478  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6479  *
6480  * # Declare pointers to A.indices ans A.indptr
6481  */
6482  __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
6483  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 595, __pyx_L1_error)
6484  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6485  __pyx_t_6.memview = NULL;
6486  __pyx_t_6.data = NULL;
6487 
6488  /* "imate/_c_linear_operator/py_c_matrix.pyx":598
6489  *
6490  * # Declare pointers to A.indices ans A.indptr
6491  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6492  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6493  *
6494  */
6495  __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
6496  __pyx_t_7 = 0;
6497  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6498 
6499  /* "imate/_c_linear_operator/py_c_matrix.pyx":599
6500  * # Declare pointers to A.indices ans A.indptr
6501  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6502  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6503  *
6504  * # Memoryview of A data
6505  */
6506  __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
6507  __pyx_t_7 = 0;
6508  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6509 
6510  /* "imate/_c_linear_operator/py_c_matrix.pyx":602
6511  *
6512  * # Memoryview of A data
6513  * A_data_double_mv = A.data # <<<<<<<<<<<<<<
6514  *
6515  * # Get pointers
6516  */
6517  __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
6518  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
6519  __Pyx_GOTREF(__pyx_t_2);
6520  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
6521  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6522  __pyx_v_A_data_double_mv = __pyx_t_8;
6523  __pyx_t_8.memview = NULL;
6524  __pyx_t_8.data = NULL;
6525 
6526  /* "imate/_c_linear_operator/py_c_matrix.pyx":605
6527  *
6528  * # Get pointers
6529  * A_data_double = &A_data_double_mv[0] # <<<<<<<<<<<<<<
6530  *
6531  * # Create a linear operator object
6532  */
6533  __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
6534  __pyx_t_7 = 0;
6535  __pyx_v_A_data_double = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
6536 
6537  /* "imate/_c_linear_operator/py_c_matrix.pyx":608
6538  *
6539  * # Create a linear operator object
6540  * self.Aop_double = new cCSCMatrix[double]( # <<<<<<<<<<<<<<
6541  * A_data_double,
6542  * A_indices,
6543  */
6544  __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error))
6545  try {
6546  __pyx_t_9 = new cCSCMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6547  } catch(...) {
6548  __Pyx_CppExn2PyErr();
6549  __PYX_ERR(0, 608, __pyx_L1_error)
6550  }
6551  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
6552 
6553  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
6554  * # =====================
6555  *
6556  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
6557  * """
6558  * """
6559  */
6560 
6561  /* function exit code */
6562  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6563  goto __pyx_L0;
6564  __pyx_L1_error:;
6565  __Pyx_XDECREF(__pyx_t_1);
6566  __Pyx_XDECREF(__pyx_t_2);
6567  __Pyx_XDECREF(__pyx_t_4);
6568  __Pyx_XDECREF(__pyx_t_5);
6569  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6570  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6571  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6572  __pyx_r = NULL;
6573  __pyx_L0:;
6574  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
6575  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6576  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6577  __Pyx_XGIVEREF(__pyx_r);
6578  __Pyx_TraceReturn(__pyx_r, 0);
6579  __Pyx_RefNannyFinishContext();
6580  return __pyx_r;
6581 }
6582 
6583 /* "imate/_c_linear_operator/py_c_matrix.pyx":619
6584  * # ==========================
6585  *
6586  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6587  * """
6588  * """
6589  */
6590 
6591 /* Python wrapper */
6592 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6593 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double[] = "pycMatrix.set_csc_matrix_long_double(self, A)\n\n ";
6594 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double = {"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double};
6595 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6596  PyObject *__pyx_r = 0;
6597  __Pyx_RefNannyDeclarations
6598  __Pyx_RefNannySetupContext("set_csc_matrix_long_double (wrapper)", 0);
6599  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6600 
6601  /* function exit code */
6602  __Pyx_RefNannyFinishContext();
6603  return __pyx_r;
6604 }
6605 
6606 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6607  LongIndexType __pyx_v_A_num_rows;
6608  LongIndexType __pyx_v_A_num_columns;
6609  __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6610  long double *__pyx_v_A_data_long_double;
6611  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6612  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6613  LongIndexType *__pyx_v_A_indices;
6614  LongIndexType *__pyx_v_A_index_pointer;
6615  PyObject *__pyx_r = NULL;
6616  __Pyx_TraceDeclarations
6617  __Pyx_RefNannyDeclarations
6618  PyObject *__pyx_t_1 = NULL;
6619  PyObject *__pyx_t_2 = NULL;
6620  LongIndexType __pyx_t_3;
6621  PyObject *__pyx_t_4 = NULL;
6622  PyObject *__pyx_t_5 = NULL;
6623  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6624  Py_ssize_t __pyx_t_7;
6625  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6626  cCSCMatrix<long double> *__pyx_t_9;
6627  int __pyx_lineno = 0;
6628  const char *__pyx_filename = NULL;
6629  int __pyx_clineno = 0;
6630  __Pyx_TraceFrameInit(__pyx_codeobj__13)
6631  __Pyx_RefNannySetupContext("set_csc_matrix_long_double", 0);
6632  __Pyx_TraceCall("set_csc_matrix_long_double", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error));
6633 
6634  /* "imate/_c_linear_operator/py_c_matrix.pyx":624
6635  *
6636  * # Matrix size
6637  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6638  * cdef LongIndexType A_num_columns = A.shape[1]
6639  *
6640  */
6641  __Pyx_TraceLine(624,0,__PYX_ERR(0, 624, __pyx_L1_error))
6642  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
6643  __Pyx_GOTREF(__pyx_t_1);
6644  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
6645  __Pyx_GOTREF(__pyx_t_2);
6646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6647  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error)
6648  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6649  __pyx_v_A_num_rows = __pyx_t_3;
6650 
6651  /* "imate/_c_linear_operator/py_c_matrix.pyx":625
6652  * # Matrix size
6653  * cdef LongIndexType A_num_rows = A.shape[0]
6654  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6655  *
6656  * # Declare memoryviews to get pointer of A.data
6657  */
6658  __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
6659  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
6660  __Pyx_GOTREF(__pyx_t_2);
6661  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
6662  __Pyx_GOTREF(__pyx_t_1);
6663  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6664  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
6665  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6666  __pyx_v_A_num_columns = __pyx_t_3;
6667 
6668  /* "imate/_c_linear_operator/py_c_matrix.pyx":635
6669  * # If the input type is the same as LongIndexType, no copy is performed.
6670  * self.A_indices_copy = \
6671  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6672  * self.A_index_pointer_copy = \
6673  * A.indptr.astype(self.long_index_type_name, copy=False)
6674  */
6675  __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
6676  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6677  __Pyx_GOTREF(__pyx_t_1);
6678  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
6679  __Pyx_GOTREF(__pyx_t_2);
6680  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6681  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6682  __Pyx_GOTREF(__pyx_t_1);
6683  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
6684  __Pyx_GOTREF(__pyx_t_4);
6685  __Pyx_GIVEREF(__pyx_t_1);
6686  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6687  __pyx_t_1 = 0;
6688  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6689  __Pyx_GOTREF(__pyx_t_1);
6690  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
6691  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
6692  __Pyx_GOTREF(__pyx_t_5);
6693  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6694  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6695  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6696 
6697  /* "imate/_c_linear_operator/py_c_matrix.pyx":634
6698  *
6699  * # If the input type is the same as LongIndexType, no copy is performed.
6700  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6701  * A.indices.astype(self.long_index_type_name, copy=False)
6702  * self.A_index_pointer_copy = \
6703  */
6704  __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
6705  __Pyx_GIVEREF(__pyx_t_5);
6706  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6707  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6708  __pyx_v_self->A_indices_copy = __pyx_t_5;
6709  __pyx_t_5 = 0;
6710 
6711  /* "imate/_c_linear_operator/py_c_matrix.pyx":637
6712  * A.indices.astype(self.long_index_type_name, copy=False)
6713  * self.A_index_pointer_copy = \
6714  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6715  *
6716  * # Declare memoryviews to get pointer of A.indices and A.indptr
6717  */
6718  __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
6719  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6720  __Pyx_GOTREF(__pyx_t_5);
6721  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
6722  __Pyx_GOTREF(__pyx_t_1);
6723  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6724  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6725  __Pyx_GOTREF(__pyx_t_5);
6726  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
6727  __Pyx_GOTREF(__pyx_t_4);
6728  __Pyx_GIVEREF(__pyx_t_5);
6729  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6730  __pyx_t_5 = 0;
6731  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6732  __Pyx_GOTREF(__pyx_t_5);
6733  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
6734  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
6735  __Pyx_GOTREF(__pyx_t_2);
6736  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6737  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6738  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6739 
6740  /* "imate/_c_linear_operator/py_c_matrix.pyx":636
6741  * self.A_indices_copy = \
6742  * A.indices.astype(self.long_index_type_name, copy=False)
6743  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6744  * A.indptr.astype(self.long_index_type_name, copy=False)
6745  *
6746  */
6747  __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error))
6748  __Pyx_GIVEREF(__pyx_t_2);
6749  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6750  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6751  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6752  __pyx_t_2 = 0;
6753 
6754  /* "imate/_c_linear_operator/py_c_matrix.pyx":640
6755  *
6756  * # Declare memoryviews to get pointer of A.indices and A.indptr
6757  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6758  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6759  * self.A_index_pointer_copy
6760  */
6761  __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
6762  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 640, __pyx_L1_error)
6763  __pyx_v_A_indices_mv = __pyx_t_6;
6764  __pyx_t_6.memview = NULL;
6765  __pyx_t_6.data = NULL;
6766 
6767  /* "imate/_c_linear_operator/py_c_matrix.pyx":642
6768  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6769  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6770  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6771  *
6772  * # Declare pointers to A.indices ans A.indptr
6773  */
6774  __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
6775  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
6776  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6777  __pyx_t_6.memview = NULL;
6778  __pyx_t_6.data = NULL;
6779 
6780  /* "imate/_c_linear_operator/py_c_matrix.pyx":645
6781  *
6782  * # Declare pointers to A.indices ans A.indptr
6783  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6784  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6785  *
6786  */
6787  __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
6788  __pyx_t_7 = 0;
6789  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6790 
6791  /* "imate/_c_linear_operator/py_c_matrix.pyx":646
6792  * # Declare pointers to A.indices ans A.indptr
6793  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6794  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6795  *
6796  * # Memoryview of A data
6797  */
6798  __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
6799  __pyx_t_7 = 0;
6800  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6801 
6802  /* "imate/_c_linear_operator/py_c_matrix.pyx":649
6803  *
6804  * # Memoryview of A data
6805  * A_data_long_double_mv = A.data # <<<<<<<<<<<<<<
6806  *
6807  * # Get pointers
6808  */
6809  __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
6810  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
6811  __Pyx_GOTREF(__pyx_t_2);
6812  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 649, __pyx_L1_error)
6813  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6814  __pyx_v_A_data_long_double_mv = __pyx_t_8;
6815  __pyx_t_8.memview = NULL;
6816  __pyx_t_8.data = NULL;
6817 
6818  /* "imate/_c_linear_operator/py_c_matrix.pyx":652
6819  *
6820  * # Get pointers
6821  * A_data_long_double = &A_data_long_double_mv[0] # <<<<<<<<<<<<<<
6822  *
6823  * # Create a linear operator object
6824  */
6825  __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
6826  __pyx_t_7 = 0;
6827  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6828 
6829  /* "imate/_c_linear_operator/py_c_matrix.pyx":655
6830  *
6831  * # Create a linear operator object
6832  * self.Aop_long_double = new cCSCMatrix[long double]( # <<<<<<<<<<<<<<
6833  * A_data_long_double,
6834  * A_indices,
6835  */
6836  __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
6837  try {
6838  __pyx_t_9 = new cCSCMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6839  } catch(...) {
6840  __Pyx_CppExn2PyErr();
6841  __PYX_ERR(0, 655, __pyx_L1_error)
6842  }
6843  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6844 
6845  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
6846  * # ==========================
6847  *
6848  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6849  * """
6850  * """
6851  */
6852 
6853  /* function exit code */
6854  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6855  goto __pyx_L0;
6856  __pyx_L1_error:;
6857  __Pyx_XDECREF(__pyx_t_1);
6858  __Pyx_XDECREF(__pyx_t_2);
6859  __Pyx_XDECREF(__pyx_t_4);
6860  __Pyx_XDECREF(__pyx_t_5);
6861  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6862  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6863  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6864  __pyx_r = NULL;
6865  __pyx_L0:;
6866  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6867  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6868  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6869  __Pyx_XGIVEREF(__pyx_r);
6870  __Pyx_TraceReturn(__pyx_r, 0);
6871  __Pyx_RefNannyFinishContext();
6872  return __pyx_r;
6873 }
6874 
6875 /* "(tree fragment)":1
6876  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6877  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6878  * def __setstate_cython__(self, __pyx_state):
6879  */
6880 
6881 /* Python wrapper */
6882 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6883 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__[] = "pycMatrix.__reduce_cython__(self)";
6884 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__};
6885 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6886  PyObject *__pyx_r = 0;
6887  __Pyx_RefNannyDeclarations
6888  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6889  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self));
6890 
6891  /* function exit code */
6892  __Pyx_RefNannyFinishContext();
6893  return __pyx_r;
6894 }
6895 
6896 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self) {
6897  PyObject *__pyx_r = NULL;
6898  __Pyx_TraceDeclarations
6899  __Pyx_RefNannyDeclarations
6900  PyObject *__pyx_t_1 = NULL;
6901  int __pyx_lineno = 0;
6902  const char *__pyx_filename = NULL;
6903  int __pyx_clineno = 0;
6904  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6905  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6906  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6907 
6908  /* "(tree fragment)":2
6909  * def __reduce_cython__(self):
6910  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6911  * def __setstate_cython__(self, __pyx_state):
6912  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6913  */
6914  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
6915  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6916  __Pyx_GOTREF(__pyx_t_1);
6917  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6918  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6919  __PYX_ERR(1, 2, __pyx_L1_error)
6920 
6921  /* "(tree fragment)":1
6922  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6923  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6924  * def __setstate_cython__(self, __pyx_state):
6925  */
6926 
6927  /* function exit code */
6928  __pyx_L1_error:;
6929  __Pyx_XDECREF(__pyx_t_1);
6930  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6931  __pyx_r = NULL;
6932  __Pyx_XGIVEREF(__pyx_r);
6933  __Pyx_TraceReturn(__pyx_r, 0);
6934  __Pyx_RefNannyFinishContext();
6935  return __pyx_r;
6936 }
6937 
6938 /* "(tree fragment)":3
6939  * def __reduce_cython__(self):
6940  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6941  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6942  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6943  */
6944 
6945 /* Python wrapper */
6946 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6947 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__[] = "pycMatrix.__setstate_cython__(self, __pyx_state)";
6948 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__};
6949 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6950  PyObject *__pyx_r = 0;
6951  __Pyx_RefNannyDeclarations
6952  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6953  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6954 
6955  /* function exit code */
6956  __Pyx_RefNannyFinishContext();
6957  return __pyx_r;
6958 }
6959 
6960 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6961  PyObject *__pyx_r = NULL;
6962  __Pyx_TraceDeclarations
6963  __Pyx_RefNannyDeclarations
6964  PyObject *__pyx_t_1 = NULL;
6965  int __pyx_lineno = 0;
6966  const char *__pyx_filename = NULL;
6967  int __pyx_clineno = 0;
6968  __Pyx_TraceFrameInit(__pyx_codeobj__16)
6969  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6970  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6971 
6972  /* "(tree fragment)":4
6973  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6974  * def __setstate_cython__(self, __pyx_state):
6975  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6976  */
6977  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
6978  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6979  __Pyx_GOTREF(__pyx_t_1);
6980  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6981  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6982  __PYX_ERR(1, 4, __pyx_L1_error)
6983 
6984  /* "(tree fragment)":3
6985  * def __reduce_cython__(self):
6986  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6987  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6988  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6989  */
6990 
6991  /* function exit code */
6992  __pyx_L1_error:;
6993  __Pyx_XDECREF(__pyx_t_1);
6994  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6995  __pyx_r = NULL;
6996  __Pyx_XGIVEREF(__pyx_r);
6997  __Pyx_TraceReturn(__pyx_r, 0);
6998  __Pyx_RefNannyFinishContext();
6999  return __pyx_r;
7000 }
7001 
7002 /* "View.MemoryView":123
7003  * cdef bint dtype_is_object
7004  *
7005  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7006  * mode="c", bint allocate_buffer=True):
7007  *
7008  */
7009 
7010 /* Python wrapper */
7011 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7012 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7013  PyObject *__pyx_v_shape = 0;
7014  Py_ssize_t __pyx_v_itemsize;
7015  PyObject *__pyx_v_format = 0;
7016  PyObject *__pyx_v_mode = 0;
7017  int __pyx_v_allocate_buffer;
7018  int __pyx_lineno = 0;
7019  const char *__pyx_filename = NULL;
7020  int __pyx_clineno = 0;
7021  int __pyx_r;
7022  __Pyx_RefNannyDeclarations
7023  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7024  {
7025  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7026  PyObject* values[5] = {0,0,0,0,0};
7027  values[3] = ((PyObject *)__pyx_n_s_c);
7028  if (unlikely(__pyx_kwds)) {
7029  Py_ssize_t kw_args;
7030  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7031  switch (pos_args) {
7032  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7033  CYTHON_FALLTHROUGH;
7034  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7035  CYTHON_FALLTHROUGH;
7036  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7037  CYTHON_FALLTHROUGH;
7038  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7039  CYTHON_FALLTHROUGH;
7040  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7041  CYTHON_FALLTHROUGH;
7042  case 0: break;
7043  default: goto __pyx_L5_argtuple_error;
7044  }
7045  kw_args = PyDict_Size(__pyx_kwds);
7046  switch (pos_args) {
7047  case 0:
7048  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7049  else goto __pyx_L5_argtuple_error;
7050  CYTHON_FALLTHROUGH;
7051  case 1:
7052  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7053  else {
7054  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
7055  }
7056  CYTHON_FALLTHROUGH;
7057  case 2:
7058  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7059  else {
7060  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
7061  }
7062  CYTHON_FALLTHROUGH;
7063  case 3:
7064  if (kw_args > 0) {
7065  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7066  if (value) { values[3] = value; kw_args--; }
7067  }
7068  CYTHON_FALLTHROUGH;
7069  case 4:
7070  if (kw_args > 0) {
7071  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7072  if (value) { values[4] = value; kw_args--; }
7073  }
7074  }
7075  if (unlikely(kw_args > 0)) {
7076  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
7077  }
7078  } else {
7079  switch (PyTuple_GET_SIZE(__pyx_args)) {
7080  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7081  CYTHON_FALLTHROUGH;
7082  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7083  CYTHON_FALLTHROUGH;
7084  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7085  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7086  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7087  break;
7088  default: goto __pyx_L5_argtuple_error;
7089  }
7090  }
7091  __pyx_v_shape = ((PyObject*)values[0]);
7092  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7093  __pyx_v_format = values[2];
7094  __pyx_v_mode = values[3];
7095  if (values[4]) {
7096  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
7097  } else {
7098 
7099  /* "View.MemoryView":124
7100  *
7101  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7102  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7103  *
7104  * cdef int idx
7105  */
7106  __pyx_v_allocate_buffer = ((int)1);
7107  }
7108  }
7109  goto __pyx_L4_argument_unpacking_done;
7110  __pyx_L5_argtuple_error:;
7111  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
7112  __pyx_L3_error:;
7113  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7114  __Pyx_RefNannyFinishContext();
7115  return -1;
7116  __pyx_L4_argument_unpacking_done:;
7117  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
7118  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7119  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 123, __pyx_L1_error)
7120  }
7121  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7122 
7123  /* "View.MemoryView":123
7124  * cdef bint dtype_is_object
7125  *
7126  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7127  * mode="c", bint allocate_buffer=True):
7128  *
7129  */
7130 
7131  /* function exit code */
7132  goto __pyx_L0;
7133  __pyx_L1_error:;
7134  __pyx_r = -1;
7135  __pyx_L0:;
7136  __Pyx_RefNannyFinishContext();
7137  return __pyx_r;
7138 }
7139 
7140 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
7141  int __pyx_v_idx;
7142  Py_ssize_t __pyx_v_i;
7143  Py_ssize_t __pyx_v_dim;
7144  PyObject **__pyx_v_p;
7145  char __pyx_v_order;
7146  int __pyx_r;
7147  __Pyx_TraceDeclarations
7148  __Pyx_RefNannyDeclarations
7149  Py_ssize_t __pyx_t_1;
7150  int __pyx_t_2;
7151  PyObject *__pyx_t_3 = NULL;
7152  int __pyx_t_4;
7153  PyObject *__pyx_t_5 = NULL;
7154  PyObject *__pyx_t_6 = NULL;
7155  char *__pyx_t_7;
7156  int __pyx_t_8;
7157  Py_ssize_t __pyx_t_9;
7158  PyObject *__pyx_t_10 = NULL;
7159  Py_ssize_t __pyx_t_11;
7160  int __pyx_lineno = 0;
7161  const char *__pyx_filename = NULL;
7162  int __pyx_clineno = 0;
7163  __Pyx_RefNannySetupContext("__cinit__", 0);
7164  __Pyx_TraceCall("__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
7165  __Pyx_INCREF(__pyx_v_format);
7166 
7167  /* "View.MemoryView":130
7168  * cdef PyObject **p
7169  *
7170  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7171  * self.itemsize = itemsize
7172  *
7173  */
7174  __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
7175  if (unlikely(__pyx_v_shape == Py_None)) {
7176  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7177  __PYX_ERR(1, 130, __pyx_L1_error)
7178  }
7179  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
7180  __pyx_v_self->ndim = ((int)__pyx_t_1);
7181 
7182  /* "View.MemoryView":131
7183  *
7184  * self.ndim = <int> len(shape)
7185  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7186  *
7187  * if not self.ndim:
7188  */
7189  __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
7190  __pyx_v_self->itemsize = __pyx_v_itemsize;
7191 
7192  /* "View.MemoryView":133
7193  * self.itemsize = itemsize
7194  *
7195  * if not self.ndim: # <<<<<<<<<<<<<<
7196  * raise ValueError("Empty shape tuple for cython.array")
7197  *
7198  */
7199  __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
7200  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7201  if (unlikely(__pyx_t_2)) {
7202 
7203  /* "View.MemoryView":134
7204  *
7205  * if not self.ndim:
7206  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7207  *
7208  * if itemsize <= 0:
7209  */
7210  __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
7211  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
7212  __Pyx_GOTREF(__pyx_t_3);
7213  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7214  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7215  __PYX_ERR(1, 134, __pyx_L1_error)
7216 
7217  /* "View.MemoryView":133
7218  * self.itemsize = itemsize
7219  *
7220  * if not self.ndim: # <<<<<<<<<<<<<<
7221  * raise ValueError("Empty shape tuple for cython.array")
7222  *
7223  */
7224  }
7225 
7226  /* "View.MemoryView":136
7227  * raise ValueError("Empty shape tuple for cython.array")
7228  *
7229  * if itemsize <= 0: # <<<<<<<<<<<<<<
7230  * raise ValueError("itemsize <= 0 for cython.array")
7231  *
7232  */
7233  __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
7234  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7235  if (unlikely(__pyx_t_2)) {
7236 
7237  /* "View.MemoryView":137
7238  *
7239  * if itemsize <= 0:
7240  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7241  *
7242  * if not isinstance(format, bytes):
7243  */
7244  __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
7245  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
7246  __Pyx_GOTREF(__pyx_t_3);
7247  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7248  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7249  __PYX_ERR(1, 137, __pyx_L1_error)
7250 
7251  /* "View.MemoryView":136
7252  * raise ValueError("Empty shape tuple for cython.array")
7253  *
7254  * if itemsize <= 0: # <<<<<<<<<<<<<<
7255  * raise ValueError("itemsize <= 0 for cython.array")
7256  *
7257  */
7258  }
7259 
7260  /* "View.MemoryView":139
7261  * raise ValueError("itemsize <= 0 for cython.array")
7262  *
7263  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7264  * format = format.encode('ASCII')
7265  * self._format = format # keep a reference to the byte string
7266  */
7267  __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
7268  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7269  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7270  if (__pyx_t_4) {
7271 
7272  /* "View.MemoryView":140
7273  *
7274  * if not isinstance(format, bytes):
7275  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7276  * self._format = format # keep a reference to the byte string
7277  * self.format = self._format
7278  */
7279  __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
7280  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
7281  __Pyx_GOTREF(__pyx_t_5);
7282  __pyx_t_6 = NULL;
7283  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7284  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7285  if (likely(__pyx_t_6)) {
7286  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7287  __Pyx_INCREF(__pyx_t_6);
7288  __Pyx_INCREF(function);
7289  __Pyx_DECREF_SET(__pyx_t_5, function);
7290  }
7291  }
7292  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7293  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7294  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
7295  __Pyx_GOTREF(__pyx_t_3);
7296  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7297  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7298  __pyx_t_3 = 0;
7299 
7300  /* "View.MemoryView":139
7301  * raise ValueError("itemsize <= 0 for cython.array")
7302  *
7303  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7304  * format = format.encode('ASCII')
7305  * self._format = format # keep a reference to the byte string
7306  */
7307  }
7308 
7309  /* "View.MemoryView":141
7310  * if not isinstance(format, bytes):
7311  * format = format.encode('ASCII')
7312  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7313  * self.format = self._format
7314  *
7315  */
7316  __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
7317  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
7318  __pyx_t_3 = __pyx_v_format;
7319  __Pyx_INCREF(__pyx_t_3);
7320  __Pyx_GIVEREF(__pyx_t_3);
7321  __Pyx_GOTREF(__pyx_v_self->_format);
7322  __Pyx_DECREF(__pyx_v_self->_format);
7323  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7324  __pyx_t_3 = 0;
7325 
7326  /* "View.MemoryView":142
7327  * format = format.encode('ASCII')
7328  * self._format = format # keep a reference to the byte string
7329  * self.format = self._format # <<<<<<<<<<<<<<
7330  *
7331  *
7332  */
7333  __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
7334  if (unlikely(__pyx_v_self->_format == Py_None)) {
7335  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7336  __PYX_ERR(1, 142, __pyx_L1_error)
7337  }
7338  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
7339  __pyx_v_self->format = __pyx_t_7;
7340 
7341  /* "View.MemoryView":145
7342  *
7343  *
7344  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7345  * self._strides = self._shape + self.ndim
7346  *
7347  */
7348  __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
7349  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7350 
7351  /* "View.MemoryView":146
7352  *
7353  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7354  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7355  *
7356  * if not self._shape:
7357  */
7358  __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
7359  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7360 
7361  /* "View.MemoryView":148
7362  * self._strides = self._shape + self.ndim
7363  *
7364  * if not self._shape: # <<<<<<<<<<<<<<
7365  * raise MemoryError("unable to allocate shape and strides.")
7366  *
7367  */
7368  __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
7369  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7370  if (unlikely(__pyx_t_4)) {
7371 
7372  /* "View.MemoryView":149
7373  *
7374  * if not self._shape:
7375  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
7376  *
7377  *
7378  */
7379  __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
7380  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
7381  __Pyx_GOTREF(__pyx_t_3);
7382  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7383  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7384  __PYX_ERR(1, 149, __pyx_L1_error)
7385 
7386  /* "View.MemoryView":148
7387  * self._strides = self._shape + self.ndim
7388  *
7389  * if not self._shape: # <<<<<<<<<<<<<<
7390  * raise MemoryError("unable to allocate shape and strides.")
7391  *
7392  */
7393  }
7394 
7395  /* "View.MemoryView":152
7396  *
7397  *
7398  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7399  * if dim <= 0:
7400  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7401  */
7402  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7403  __pyx_t_8 = 0;
7404  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7405  for (;;) {
7406  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
7407  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7408  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
7409  #else
7410  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
7411  __Pyx_GOTREF(__pyx_t_5);
7412  #endif
7413  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
7414  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7415  __pyx_v_dim = __pyx_t_9;
7416  __pyx_v_idx = __pyx_t_8;
7417  __pyx_t_8 = (__pyx_t_8 + 1);
7418 
7419  /* "View.MemoryView":153
7420  *
7421  * for idx, dim in enumerate(shape):
7422  * if dim <= 0: # <<<<<<<<<<<<<<
7423  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7424  * self._shape[idx] = dim
7425  */
7426  __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
7427  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7428  if (unlikely(__pyx_t_4)) {
7429 
7430  /* "View.MemoryView":154
7431  * for idx, dim in enumerate(shape):
7432  * if dim <= 0:
7433  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
7434  * self._shape[idx] = dim
7435  *
7436  */
7437  __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
7438  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
7439  __Pyx_GOTREF(__pyx_t_5);
7440  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7441  __Pyx_GOTREF(__pyx_t_6);
7442  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7443  __Pyx_GOTREF(__pyx_t_10);
7444  __Pyx_GIVEREF(__pyx_t_5);
7445  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7446  __Pyx_GIVEREF(__pyx_t_6);
7447  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7448  __pyx_t_5 = 0;
7449  __pyx_t_6 = 0;
7450  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7451  __Pyx_GOTREF(__pyx_t_6);
7452  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7453  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7454  __Pyx_GOTREF(__pyx_t_10);
7455  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7456  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7457  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7458  __PYX_ERR(1, 154, __pyx_L1_error)
7459 
7460  /* "View.MemoryView":153
7461  *
7462  * for idx, dim in enumerate(shape):
7463  * if dim <= 0: # <<<<<<<<<<<<<<
7464  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7465  * self._shape[idx] = dim
7466  */
7467  }
7468 
7469  /* "View.MemoryView":155
7470  * if dim <= 0:
7471  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7472  * self._shape[idx] = dim # <<<<<<<<<<<<<<
7473  *
7474  * cdef char order
7475  */
7476  __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
7477  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7478 
7479  /* "View.MemoryView":152
7480  *
7481  *
7482  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7483  * if dim <= 0:
7484  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7485  */
7486  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7487  }
7488  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7489 
7490  /* "View.MemoryView":158
7491  *
7492  * cdef char order
7493  * if mode == 'fortran': # <<<<<<<<<<<<<<
7494  * order = b'F'
7495  * self.mode = u'fortran'
7496  */
7497  __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
7498  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
7499  if (__pyx_t_4) {
7500 
7501  /* "View.MemoryView":159
7502  * cdef char order
7503  * if mode == 'fortran':
7504  * order = b'F' # <<<<<<<<<<<<<<
7505  * self.mode = u'fortran'
7506  * elif mode == 'c':
7507  */
7508  __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
7509  __pyx_v_order = 'F';
7510 
7511  /* "View.MemoryView":160
7512  * if mode == 'fortran':
7513  * order = b'F'
7514  * self.mode = u'fortran' # <<<<<<<<<<<<<<
7515  * elif mode == 'c':
7516  * order = b'C'
7517  */
7518  __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
7519  __Pyx_INCREF(__pyx_n_u_fortran);
7520  __Pyx_GIVEREF(__pyx_n_u_fortran);
7521  __Pyx_GOTREF(__pyx_v_self->mode);
7522  __Pyx_DECREF(__pyx_v_self->mode);
7523  __pyx_v_self->mode = __pyx_n_u_fortran;
7524 
7525  /* "View.MemoryView":158
7526  *
7527  * cdef char order
7528  * if mode == 'fortran': # <<<<<<<<<<<<<<
7529  * order = b'F'
7530  * self.mode = u'fortran'
7531  */
7532  goto __pyx_L10;
7533  }
7534 
7535  /* "View.MemoryView":161
7536  * order = b'F'
7537  * self.mode = u'fortran'
7538  * elif mode == 'c': # <<<<<<<<<<<<<<
7539  * order = b'C'
7540  * self.mode = u'c'
7541  */
7542  __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
7543  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
7544  if (likely(__pyx_t_4)) {
7545 
7546  /* "View.MemoryView":162
7547  * self.mode = u'fortran'
7548  * elif mode == 'c':
7549  * order = b'C' # <<<<<<<<<<<<<<
7550  * self.mode = u'c'
7551  * else:
7552  */
7553  __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
7554  __pyx_v_order = 'C';
7555 
7556  /* "View.MemoryView":163
7557  * elif mode == 'c':
7558  * order = b'C'
7559  * self.mode = u'c' # <<<<<<<<<<<<<<
7560  * else:
7561  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7562  */
7563  __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
7564  __Pyx_INCREF(__pyx_n_u_c);
7565  __Pyx_GIVEREF(__pyx_n_u_c);
7566  __Pyx_GOTREF(__pyx_v_self->mode);
7567  __Pyx_DECREF(__pyx_v_self->mode);
7568  __pyx_v_self->mode = __pyx_n_u_c;
7569 
7570  /* "View.MemoryView":161
7571  * order = b'F'
7572  * self.mode = u'fortran'
7573  * elif mode == 'c': # <<<<<<<<<<<<<<
7574  * order = b'C'
7575  * self.mode = u'c'
7576  */
7577  goto __pyx_L10;
7578  }
7579 
7580  /* "View.MemoryView":165
7581  * self.mode = u'c'
7582  * else:
7583  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
7584  *
7585  * self.len = fill_contig_strides_array(self._shape, self._strides,
7586  */
7587  __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
7588  /*else*/ {
7589  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
7590  __Pyx_GOTREF(__pyx_t_3);
7591  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
7592  __Pyx_GOTREF(__pyx_t_10);
7593  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7594  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7595  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7596  __PYX_ERR(1, 165, __pyx_L1_error)
7597  }
7598  __pyx_L10:;
7599 
7600  /* "View.MemoryView":167
7601  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7602  *
7603  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
7604  * itemsize, self.ndim, order)
7605  *
7606  */
7607  __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
7608  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7609 
7610  /* "View.MemoryView":170
7611  * itemsize, self.ndim, order)
7612  *
7613  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
7614  * self.dtype_is_object = format == b'O'
7615  * if allocate_buffer:
7616  */
7617  __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7618  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7619 
7620  /* "View.MemoryView":171
7621  *
7622  * self.free_data = allocate_buffer
7623  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
7624  * if allocate_buffer:
7625  *
7626  */
7627  __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7628  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
7629  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
7630  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7631  __pyx_v_self->dtype_is_object = __pyx_t_4;
7632 
7633  /* "View.MemoryView":172
7634  * self.free_data = allocate_buffer
7635  * self.dtype_is_object = format == b'O'
7636  * if allocate_buffer: # <<<<<<<<<<<<<<
7637  *
7638  *
7639  */
7640  __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
7641  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7642  if (__pyx_t_4) {
7643 
7644  /* "View.MemoryView":175
7645  *
7646  *
7647  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7648  * if not self.data:
7649  * raise MemoryError("unable to allocate array data.")
7650  */
7651  __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7652  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7653 
7654  /* "View.MemoryView":176
7655  *
7656  * self.data = <char *>malloc(self.len)
7657  * if not self.data: # <<<<<<<<<<<<<<
7658  * raise MemoryError("unable to allocate array data.")
7659  *
7660  */
7661  __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7662  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7663  if (unlikely(__pyx_t_4)) {
7664 
7665  /* "View.MemoryView":177
7666  * self.data = <char *>malloc(self.len)
7667  * if not self.data:
7668  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
7669  *
7670  * if self.dtype_is_object:
7671  */
7672  __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
7673  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
7674  __Pyx_GOTREF(__pyx_t_10);
7675  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7676  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7677  __PYX_ERR(1, 177, __pyx_L1_error)
7678 
7679  /* "View.MemoryView":176
7680  *
7681  * self.data = <char *>malloc(self.len)
7682  * if not self.data: # <<<<<<<<<<<<<<
7683  * raise MemoryError("unable to allocate array data.")
7684  *
7685  */
7686  }
7687 
7688  /* "View.MemoryView":179
7689  * raise MemoryError("unable to allocate array data.")
7690  *
7691  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7692  * p = <PyObject **> self.data
7693  * for i in range(self.len / itemsize):
7694  */
7695  __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7696  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7697  if (__pyx_t_4) {
7698 
7699  /* "View.MemoryView":180
7700  *
7701  * if self.dtype_is_object:
7702  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7703  * for i in range(self.len / itemsize):
7704  * p[i] = Py_None
7705  */
7706  __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7707  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7708 
7709  /* "View.MemoryView":181
7710  * if self.dtype_is_object:
7711  * p = <PyObject **> self.data
7712  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
7713  * p[i] = Py_None
7714  * Py_INCREF(Py_None)
7715  */
7716  __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7717  if (unlikely(__pyx_v_itemsize == 0)) {
7718  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7719  __PYX_ERR(1, 181, __pyx_L1_error)
7720  }
7721  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7722  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
7723  __PYX_ERR(1, 181, __pyx_L1_error)
7724  }
7725  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7726  __pyx_t_9 = __pyx_t_1;
7727  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7728  __pyx_v_i = __pyx_t_11;
7729 
7730  /* "View.MemoryView":182
7731  * p = <PyObject **> self.data
7732  * for i in range(self.len / itemsize):
7733  * p[i] = Py_None # <<<<<<<<<<<<<<
7734  * Py_INCREF(Py_None)
7735  *
7736  */
7737  __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7738  (__pyx_v_p[__pyx_v_i]) = Py_None;
7739 
7740  /* "View.MemoryView":183
7741  * for i in range(self.len / itemsize):
7742  * p[i] = Py_None
7743  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7744  *
7745  * @cname('getbuffer')
7746  */
7747  __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
7748  Py_INCREF(Py_None);
7749  }
7750 
7751  /* "View.MemoryView":179
7752  * raise MemoryError("unable to allocate array data.")
7753  *
7754  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7755  * p = <PyObject **> self.data
7756  * for i in range(self.len / itemsize):
7757  */
7758  }
7759 
7760  /* "View.MemoryView":172
7761  * self.free_data = allocate_buffer
7762  * self.dtype_is_object = format == b'O'
7763  * if allocate_buffer: # <<<<<<<<<<<<<<
7764  *
7765  *
7766  */
7767  }
7768 
7769  /* "View.MemoryView":123
7770  * cdef bint dtype_is_object
7771  *
7772  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7773  * mode="c", bint allocate_buffer=True):
7774  *
7775  */
7776 
7777  /* function exit code */
7778  __pyx_r = 0;
7779  goto __pyx_L0;
7780  __pyx_L1_error:;
7781  __Pyx_XDECREF(__pyx_t_3);
7782  __Pyx_XDECREF(__pyx_t_5);
7783  __Pyx_XDECREF(__pyx_t_6);
7784  __Pyx_XDECREF(__pyx_t_10);
7785  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7786  __pyx_r = -1;
7787  __pyx_L0:;
7788  __Pyx_XDECREF(__pyx_v_format);
7789  __Pyx_TraceReturn(Py_None, 0);
7790  __Pyx_RefNannyFinishContext();
7791  return __pyx_r;
7792 }
7793 
7794 /* "View.MemoryView":186
7795  *
7796  * @cname('getbuffer')
7797  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7798  * cdef int bufmode = -1
7799  * if self.mode == u"c":
7800  */
7801 
7802 /* Python wrapper */
7803 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7804 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7805  int __pyx_r;
7806  __Pyx_RefNannyDeclarations
7807  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7808  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
7809 
7810  /* function exit code */
7811  __Pyx_RefNannyFinishContext();
7812  return __pyx_r;
7813 }
7814 
7815 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7816  int __pyx_v_bufmode;
7817  int __pyx_r;
7818  __Pyx_TraceDeclarations
7819  __Pyx_RefNannyDeclarations
7820  int __pyx_t_1;
7821  int __pyx_t_2;
7822  PyObject *__pyx_t_3 = NULL;
7823  char *__pyx_t_4;
7824  Py_ssize_t __pyx_t_5;
7825  int __pyx_t_6;
7826  Py_ssize_t *__pyx_t_7;
7827  int __pyx_lineno = 0;
7828  const char *__pyx_filename = NULL;
7829  int __pyx_clineno = 0;
7830  if (__pyx_v_info == NULL) {
7831  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
7832  return -1;
7833  }
7834  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7835  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7836  __Pyx_GIVEREF(__pyx_v_info->obj);
7837  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
7838 
7839  /* "View.MemoryView":187
7840  * @cname('getbuffer')
7841  * def __getbuffer__(self, Py_buffer *info, int flags):
7842  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
7843  * if self.mode == u"c":
7844  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7845  */
7846  __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7847  __pyx_v_bufmode = -1;
7848 
7849  /* "View.MemoryView":188
7850  * def __getbuffer__(self, Py_buffer *info, int flags):
7851  * cdef int bufmode = -1
7852  * if self.mode == u"c": # <<<<<<<<<<<<<<
7853  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7854  * elif self.mode == u"fortran":
7855  */
7856  __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7857  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
7858  __pyx_t_2 = (__pyx_t_1 != 0);
7859  if (__pyx_t_2) {
7860 
7861  /* "View.MemoryView":189
7862  * cdef int bufmode = -1
7863  * if self.mode == u"c":
7864  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7865  * elif self.mode == u"fortran":
7866  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7867  */
7868  __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7869  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7870 
7871  /* "View.MemoryView":188
7872  * def __getbuffer__(self, Py_buffer *info, int flags):
7873  * cdef int bufmode = -1
7874  * if self.mode == u"c": # <<<<<<<<<<<<<<
7875  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7876  * elif self.mode == u"fortran":
7877  */
7878  goto __pyx_L3;
7879  }
7880 
7881  /* "View.MemoryView":190
7882  * if self.mode == u"c":
7883  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7884  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7885  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7886  * if not (flags & bufmode):
7887  */
7888  __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7889  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
7890  __pyx_t_1 = (__pyx_t_2 != 0);
7891  if (__pyx_t_1) {
7892 
7893  /* "View.MemoryView":191
7894  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7895  * elif self.mode == u"fortran":
7896  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7897  * if not (flags & bufmode):
7898  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7899  */
7900  __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7901  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7902 
7903  /* "View.MemoryView":190
7904  * if self.mode == u"c":
7905  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7906  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7907  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7908  * if not (flags & bufmode):
7909  */
7910  }
7911  __pyx_L3:;
7912 
7913  /* "View.MemoryView":192
7914  * elif self.mode == u"fortran":
7915  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7916  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7917  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7918  * info.buf = self.data
7919  */
7920  __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
7921  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7922  if (unlikely(__pyx_t_1)) {
7923 
7924  /* "View.MemoryView":193
7925  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7926  * if not (flags & bufmode):
7927  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
7928  * info.buf = self.data
7929  * info.len = self.len
7930  */
7931  __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
7932  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
7933  __Pyx_GOTREF(__pyx_t_3);
7934  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7935  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7936  __PYX_ERR(1, 193, __pyx_L1_error)
7937 
7938  /* "View.MemoryView":192
7939  * elif self.mode == u"fortran":
7940  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7941  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7942  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7943  * info.buf = self.data
7944  */
7945  }
7946 
7947  /* "View.MemoryView":194
7948  * if not (flags & bufmode):
7949  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7950  * info.buf = self.data # <<<<<<<<<<<<<<
7951  * info.len = self.len
7952  * info.ndim = self.ndim
7953  */
7954  __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
7955  __pyx_t_4 = __pyx_v_self->data;
7956  __pyx_v_info->buf = __pyx_t_4;
7957 
7958  /* "View.MemoryView":195
7959  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7960  * info.buf = self.data
7961  * info.len = self.len # <<<<<<<<<<<<<<
7962  * info.ndim = self.ndim
7963  * info.shape = self._shape
7964  */
7965  __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
7966  __pyx_t_5 = __pyx_v_self->len;
7967  __pyx_v_info->len = __pyx_t_5;
7968 
7969  /* "View.MemoryView":196
7970  * info.buf = self.data
7971  * info.len = self.len
7972  * info.ndim = self.ndim # <<<<<<<<<<<<<<
7973  * info.shape = self._shape
7974  * info.strides = self._strides
7975  */
7976  __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
7977  __pyx_t_6 = __pyx_v_self->ndim;
7978  __pyx_v_info->ndim = __pyx_t_6;
7979 
7980  /* "View.MemoryView":197
7981  * info.len = self.len
7982  * info.ndim = self.ndim
7983  * info.shape = self._shape # <<<<<<<<<<<<<<
7984  * info.strides = self._strides
7985  * info.suboffsets = NULL
7986  */
7987  __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
7988  __pyx_t_7 = __pyx_v_self->_shape;
7989  __pyx_v_info->shape = __pyx_t_7;
7990 
7991  /* "View.MemoryView":198
7992  * info.ndim = self.ndim
7993  * info.shape = self._shape
7994  * info.strides = self._strides # <<<<<<<<<<<<<<
7995  * info.suboffsets = NULL
7996  * info.itemsize = self.itemsize
7997  */
7998  __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
7999  __pyx_t_7 = __pyx_v_self->_strides;
8000  __pyx_v_info->strides = __pyx_t_7;
8001 
8002  /* "View.MemoryView":199
8003  * info.shape = self._shape
8004  * info.strides = self._strides
8005  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8006  * info.itemsize = self.itemsize
8007  * info.readonly = 0
8008  */
8009  __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
8010  __pyx_v_info->suboffsets = NULL;
8011 
8012  /* "View.MemoryView":200
8013  * info.strides = self._strides
8014  * info.suboffsets = NULL
8015  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8016  * info.readonly = 0
8017  *
8018  */
8019  __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
8020  __pyx_t_5 = __pyx_v_self->itemsize;
8021  __pyx_v_info->itemsize = __pyx_t_5;
8022 
8023  /* "View.MemoryView":201
8024  * info.suboffsets = NULL
8025  * info.itemsize = self.itemsize
8026  * info.readonly = 0 # <<<<<<<<<<<<<<
8027  *
8028  * if flags & PyBUF_FORMAT:
8029  */
8030  __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
8031  __pyx_v_info->readonly = 0;
8032 
8033  /* "View.MemoryView":203
8034  * info.readonly = 0
8035  *
8036  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8037  * info.format = self.format
8038  * else:
8039  */
8040  __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
8041  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8042  if (__pyx_t_1) {
8043 
8044  /* "View.MemoryView":204
8045  *
8046  * if flags & PyBUF_FORMAT:
8047  * info.format = self.format # <<<<<<<<<<<<<<
8048  * else:
8049  * info.format = NULL
8050  */
8051  __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
8052  __pyx_t_4 = __pyx_v_self->format;
8053  __pyx_v_info->format = __pyx_t_4;
8054 
8055  /* "View.MemoryView":203
8056  * info.readonly = 0
8057  *
8058  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8059  * info.format = self.format
8060  * else:
8061  */
8062  goto __pyx_L5;
8063  }
8064 
8065  /* "View.MemoryView":206
8066  * info.format = self.format
8067  * else:
8068  * info.format = NULL # <<<<<<<<<<<<<<
8069  *
8070  * info.obj = self
8071  */
8072  __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
8073  /*else*/ {
8074  __pyx_v_info->format = NULL;
8075  }
8076  __pyx_L5:;
8077 
8078  /* "View.MemoryView":208
8079  * info.format = NULL
8080  *
8081  * info.obj = self # <<<<<<<<<<<<<<
8082  *
8083  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8084  */
8085  __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
8086  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8087  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8088  __Pyx_GOTREF(__pyx_v_info->obj);
8089  __Pyx_DECREF(__pyx_v_info->obj);
8090  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8091 
8092  /* "View.MemoryView":186
8093  *
8094  * @cname('getbuffer')
8095  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8096  * cdef int bufmode = -1
8097  * if self.mode == u"c":
8098  */
8099 
8100  /* function exit code */
8101  __pyx_r = 0;
8102  goto __pyx_L0;
8103  __pyx_L1_error:;
8104  __Pyx_XDECREF(__pyx_t_3);
8105  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8106  __pyx_r = -1;
8107  if (__pyx_v_info->obj != NULL) {
8108  __Pyx_GOTREF(__pyx_v_info->obj);
8109  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8110  }
8111  goto __pyx_L2;
8112  __pyx_L0:;
8113  if (__pyx_v_info->obj == Py_None) {
8114  __Pyx_GOTREF(__pyx_v_info->obj);
8115  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8116  }
8117  __pyx_L2:;
8118  __Pyx_TraceReturn(Py_None, 0);
8119  __Pyx_RefNannyFinishContext();
8120  return __pyx_r;
8121 }
8122 
8123 /* "View.MemoryView":212
8124  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8125  *
8126  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8127  * if self.callback_free_data != NULL:
8128  * self.callback_free_data(self.data)
8129  */
8130 
8131 /* Python wrapper */
8132 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8133 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8134  __Pyx_RefNannyDeclarations
8135  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8136  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8137 
8138  /* function exit code */
8139  __Pyx_RefNannyFinishContext();
8140 }
8141 
8142 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8143  __Pyx_TraceDeclarations
8144  __Pyx_RefNannyDeclarations
8145  int __pyx_t_1;
8146  int __pyx_lineno = 0;
8147  const char *__pyx_filename = NULL;
8148  int __pyx_clineno = 0;
8149  __Pyx_RefNannySetupContext("__dealloc__", 0);
8150  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
8151 
8152  /* "View.MemoryView":213
8153  *
8154  * def __dealloc__(array self):
8155  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8156  * self.callback_free_data(self.data)
8157  * elif self.free_data:
8158  */
8159  __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
8160  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8161  if (__pyx_t_1) {
8162 
8163  /* "View.MemoryView":214
8164  * def __dealloc__(array self):
8165  * if self.callback_free_data != NULL:
8166  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8167  * elif self.free_data:
8168  * if self.dtype_is_object:
8169  */
8170  __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
8171  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8172 
8173  /* "View.MemoryView":213
8174  *
8175  * def __dealloc__(array self):
8176  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8177  * self.callback_free_data(self.data)
8178  * elif self.free_data:
8179  */
8180  goto __pyx_L3;
8181  }
8182 
8183  /* "View.MemoryView":215
8184  * if self.callback_free_data != NULL:
8185  * self.callback_free_data(self.data)
8186  * elif self.free_data: # <<<<<<<<<<<<<<
8187  * if self.dtype_is_object:
8188  * refcount_objects_in_slice(self.data, self._shape,
8189  */
8190  __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
8191  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8192  if (__pyx_t_1) {
8193 
8194  /* "View.MemoryView":216
8195  * self.callback_free_data(self.data)
8196  * elif self.free_data:
8197  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8198  * refcount_objects_in_slice(self.data, self._shape,
8199  * self._strides, self.ndim, False)
8200  */
8201  __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
8202  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8203  if (__pyx_t_1) {
8204 
8205  /* "View.MemoryView":217
8206  * elif self.free_data:
8207  * if self.dtype_is_object:
8208  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8209  * self._strides, self.ndim, False)
8210  * free(self.data)
8211  */
8212  __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
8213  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8214 
8215  /* "View.MemoryView":216
8216  * self.callback_free_data(self.data)
8217  * elif self.free_data:
8218  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8219  * refcount_objects_in_slice(self.data, self._shape,
8220  * self._strides, self.ndim, False)
8221  */
8222  }
8223 
8224  /* "View.MemoryView":219
8225  * refcount_objects_in_slice(self.data, self._shape,
8226  * self._strides, self.ndim, False)
8227  * free(self.data) # <<<<<<<<<<<<<<
8228  * PyObject_Free(self._shape)
8229  *
8230  */
8231  __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
8232  free(__pyx_v_self->data);
8233 
8234  /* "View.MemoryView":215
8235  * if self.callback_free_data != NULL:
8236  * self.callback_free_data(self.data)
8237  * elif self.free_data: # <<<<<<<<<<<<<<
8238  * if self.dtype_is_object:
8239  * refcount_objects_in_slice(self.data, self._shape,
8240  */
8241  }
8242  __pyx_L3:;
8243 
8244  /* "View.MemoryView":220
8245  * self._strides, self.ndim, False)
8246  * free(self.data)
8247  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8248  *
8249  * @property
8250  */
8251  __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
8252  PyObject_Free(__pyx_v_self->_shape);
8253 
8254  /* "View.MemoryView":212
8255  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8256  *
8257  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8258  * if self.callback_free_data != NULL:
8259  * self.callback_free_data(self.data)
8260  */
8261 
8262  /* function exit code */
8263  goto __pyx_L0;
8264  __pyx_L1_error:;
8265  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8266  __pyx_L0:;
8267  __Pyx_TraceReturn(Py_None, 0);
8268  __Pyx_RefNannyFinishContext();
8269 }
8270 
8271 /* "View.MemoryView":223
8272  *
8273  * @property
8274  * def memview(self): # <<<<<<<<<<<<<<
8275  * return self.get_memview()
8276  *
8277  */
8278 
8279 /* Python wrapper */
8280 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8281 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8282  PyObject *__pyx_r = 0;
8283  __Pyx_RefNannyDeclarations
8284  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8285  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8286 
8287  /* function exit code */
8288  __Pyx_RefNannyFinishContext();
8289  return __pyx_r;
8290 }
8291 
8292 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8293  PyObject *__pyx_r = NULL;
8294  __Pyx_TraceDeclarations
8295  __Pyx_RefNannyDeclarations
8296  PyObject *__pyx_t_1 = NULL;
8297  int __pyx_lineno = 0;
8298  const char *__pyx_filename = NULL;
8299  int __pyx_clineno = 0;
8300  __Pyx_RefNannySetupContext("__get__", 0);
8301  __Pyx_TraceCall("__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
8302 
8303  /* "View.MemoryView":224
8304  * @property
8305  * def memview(self):
8306  * return self.get_memview() # <<<<<<<<<<<<<<
8307  *
8308  * @cname('get_memview')
8309  */
8310  __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
8311  __Pyx_XDECREF(__pyx_r);
8312  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
8313  __Pyx_GOTREF(__pyx_t_1);
8314  __pyx_r = __pyx_t_1;
8315  __pyx_t_1 = 0;
8316  goto __pyx_L0;
8317 
8318  /* "View.MemoryView":223
8319  *
8320  * @property
8321  * def memview(self): # <<<<<<<<<<<<<<
8322  * return self.get_memview()
8323  *
8324  */
8325 
8326  /* function exit code */
8327  __pyx_L1_error:;
8328  __Pyx_XDECREF(__pyx_t_1);
8329  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8330  __pyx_r = NULL;
8331  __pyx_L0:;
8332  __Pyx_XGIVEREF(__pyx_r);
8333  __Pyx_TraceReturn(__pyx_r, 0);
8334  __Pyx_RefNannyFinishContext();
8335  return __pyx_r;
8336 }
8337 
8338 /* "View.MemoryView":227
8339  *
8340  * @cname('get_memview')
8341  * cdef get_memview(self): # <<<<<<<<<<<<<<
8342  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8343  * return memoryview(self, flags, self.dtype_is_object)
8344  */
8345 
8346 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8347  int __pyx_v_flags;
8348  PyObject *__pyx_r = NULL;
8349  __Pyx_TraceDeclarations
8350  __Pyx_RefNannyDeclarations
8351  PyObject *__pyx_t_1 = NULL;
8352  PyObject *__pyx_t_2 = NULL;
8353  PyObject *__pyx_t_3 = NULL;
8354  int __pyx_lineno = 0;
8355  const char *__pyx_filename = NULL;
8356  int __pyx_clineno = 0;
8357  __Pyx_RefNannySetupContext("get_memview", 0);
8358  __Pyx_TraceCall("get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
8359 
8360  /* "View.MemoryView":228
8361  * @cname('get_memview')
8362  * cdef get_memview(self):
8363  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8364  * return memoryview(self, flags, self.dtype_is_object)
8365  *
8366  */
8367  __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
8368  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8369 
8370  /* "View.MemoryView":229
8371  * cdef get_memview(self):
8372  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8373  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8374  *
8375  * def __len__(self):
8376  */
8377  __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
8378  __Pyx_XDECREF(__pyx_r);
8379  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
8380  __Pyx_GOTREF(__pyx_t_1);
8381  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8382  __Pyx_GOTREF(__pyx_t_2);
8383  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
8384  __Pyx_GOTREF(__pyx_t_3);
8385  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8386  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8387  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8388  __Pyx_GIVEREF(__pyx_t_1);
8389  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8390  __Pyx_GIVEREF(__pyx_t_2);
8391  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8392  __pyx_t_1 = 0;
8393  __pyx_t_2 = 0;
8394  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8395  __Pyx_GOTREF(__pyx_t_2);
8396  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8397  __pyx_r = __pyx_t_2;
8398  __pyx_t_2 = 0;
8399  goto __pyx_L0;
8400 
8401  /* "View.MemoryView":227
8402  *
8403  * @cname('get_memview')
8404  * cdef get_memview(self): # <<<<<<<<<<<<<<
8405  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8406  * return memoryview(self, flags, self.dtype_is_object)
8407  */
8408 
8409  /* function exit code */
8410  __pyx_L1_error:;
8411  __Pyx_XDECREF(__pyx_t_1);
8412  __Pyx_XDECREF(__pyx_t_2);
8413  __Pyx_XDECREF(__pyx_t_3);
8414  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8415  __pyx_r = 0;
8416  __pyx_L0:;
8417  __Pyx_XGIVEREF(__pyx_r);
8418  __Pyx_TraceReturn(__pyx_r, 0);
8419  __Pyx_RefNannyFinishContext();
8420  return __pyx_r;
8421 }
8422 
8423 /* "View.MemoryView":231
8424  * return memoryview(self, flags, self.dtype_is_object)
8425  *
8426  * def __len__(self): # <<<<<<<<<<<<<<
8427  * return self._shape[0]
8428  *
8429  */
8430 
8431 /* Python wrapper */
8432 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
8433 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8434  Py_ssize_t __pyx_r;
8435  __Pyx_RefNannyDeclarations
8436  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
8437  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
8438 
8439  /* function exit code */
8440  __Pyx_RefNannyFinishContext();
8441  return __pyx_r;
8442 }
8443 
8444 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
8445  Py_ssize_t __pyx_r;
8446  __Pyx_TraceDeclarations
8447  __Pyx_RefNannyDeclarations
8448  int __pyx_lineno = 0;
8449  const char *__pyx_filename = NULL;
8450  int __pyx_clineno = 0;
8451  __Pyx_RefNannySetupContext("__len__", 0);
8452  __Pyx_TraceCall("__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
8453 
8454  /* "View.MemoryView":232
8455  *
8456  * def __len__(self):
8457  * return self._shape[0] # <<<<<<<<<<<<<<
8458  *
8459  * def __getattr__(self, attr):
8460  */
8461  __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
8462  __pyx_r = (__pyx_v_self->_shape[0]);
8463  goto __pyx_L0;
8464 
8465  /* "View.MemoryView":231
8466  * return memoryview(self, flags, self.dtype_is_object)
8467  *
8468  * def __len__(self): # <<<<<<<<<<<<<<
8469  * return self._shape[0]
8470  *
8471  */
8472 
8473  /* function exit code */
8474  __pyx_L1_error:;
8475  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8476  __pyx_r = -1;
8477  __pyx_L0:;
8478  __Pyx_TraceReturn(Py_None, 0);
8479  __Pyx_RefNannyFinishContext();
8480  return __pyx_r;
8481 }
8482 
8483 /* "View.MemoryView":234
8484  * return self._shape[0]
8485  *
8486  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8487  * return getattr(self.memview, attr)
8488  *
8489  */
8490 
8491 /* Python wrapper */
8492 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
8493 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8494  PyObject *__pyx_r = 0;
8495  __Pyx_RefNannyDeclarations
8496  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
8497  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8498 
8499  /* function exit code */
8500  __Pyx_RefNannyFinishContext();
8501  return __pyx_r;
8502 }
8503 
8504 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8505  PyObject *__pyx_r = NULL;
8506  __Pyx_TraceDeclarations
8507  __Pyx_RefNannyDeclarations
8508  PyObject *__pyx_t_1 = NULL;
8509  PyObject *__pyx_t_2 = NULL;
8510  int __pyx_lineno = 0;
8511  const char *__pyx_filename = NULL;
8512  int __pyx_clineno = 0;
8513  __Pyx_RefNannySetupContext("__getattr__", 0);
8514  __Pyx_TraceCall("__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
8515 
8516  /* "View.MemoryView":235
8517  *
8518  * def __getattr__(self, attr):
8519  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
8520  *
8521  * def __getitem__(self, item):
8522  */
8523  __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
8524  __Pyx_XDECREF(__pyx_r);
8525  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
8526  __Pyx_GOTREF(__pyx_t_1);
8527  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
8528  __Pyx_GOTREF(__pyx_t_2);
8529  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8530  __pyx_r = __pyx_t_2;
8531  __pyx_t_2 = 0;
8532  goto __pyx_L0;
8533 
8534  /* "View.MemoryView":234
8535  * return self._shape[0]
8536  *
8537  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8538  * return getattr(self.memview, attr)
8539  *
8540  */
8541 
8542  /* function exit code */
8543  __pyx_L1_error:;
8544  __Pyx_XDECREF(__pyx_t_1);
8545  __Pyx_XDECREF(__pyx_t_2);
8546  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8547  __pyx_r = NULL;
8548  __pyx_L0:;
8549  __Pyx_XGIVEREF(__pyx_r);
8550  __Pyx_TraceReturn(__pyx_r, 0);
8551  __Pyx_RefNannyFinishContext();
8552  return __pyx_r;
8553 }
8554 
8555 /* "View.MemoryView":237
8556  * return getattr(self.memview, attr)
8557  *
8558  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8559  * return self.memview[item]
8560  *
8561  */
8562 
8563 /* Python wrapper */
8564 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
8565 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8566  PyObject *__pyx_r = 0;
8567  __Pyx_RefNannyDeclarations
8568  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8569  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8570 
8571  /* function exit code */
8572  __Pyx_RefNannyFinishContext();
8573  return __pyx_r;
8574 }
8575 
8576 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8577  PyObject *__pyx_r = NULL;
8578  __Pyx_TraceDeclarations
8579  __Pyx_RefNannyDeclarations
8580  PyObject *__pyx_t_1 = NULL;
8581  PyObject *__pyx_t_2 = NULL;
8582  int __pyx_lineno = 0;
8583  const char *__pyx_filename = NULL;
8584  int __pyx_clineno = 0;
8585  __Pyx_RefNannySetupContext("__getitem__", 0);
8586  __Pyx_TraceCall("__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
8587 
8588  /* "View.MemoryView":238
8589  *
8590  * def __getitem__(self, item):
8591  * return self.memview[item] # <<<<<<<<<<<<<<
8592  *
8593  * def __setitem__(self, item, value):
8594  */
8595  __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
8596  __Pyx_XDECREF(__pyx_r);
8597  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
8598  __Pyx_GOTREF(__pyx_t_1);
8599  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
8600  __Pyx_GOTREF(__pyx_t_2);
8601  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8602  __pyx_r = __pyx_t_2;
8603  __pyx_t_2 = 0;
8604  goto __pyx_L0;
8605 
8606  /* "View.MemoryView":237
8607  * return getattr(self.memview, attr)
8608  *
8609  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8610  * return self.memview[item]
8611  *
8612  */
8613 
8614  /* function exit code */
8615  __pyx_L1_error:;
8616  __Pyx_XDECREF(__pyx_t_1);
8617  __Pyx_XDECREF(__pyx_t_2);
8618  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8619  __pyx_r = NULL;
8620  __pyx_L0:;
8621  __Pyx_XGIVEREF(__pyx_r);
8622  __Pyx_TraceReturn(__pyx_r, 0);
8623  __Pyx_RefNannyFinishContext();
8624  return __pyx_r;
8625 }
8626 
8627 /* "View.MemoryView":240
8628  * return self.memview[item]
8629  *
8630  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8631  * self.memview[item] = value
8632  *
8633  */
8634 
8635 /* Python wrapper */
8636 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
8637 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8638  int __pyx_r;
8639  __Pyx_RefNannyDeclarations
8640  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8641  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8642 
8643  /* function exit code */
8644  __Pyx_RefNannyFinishContext();
8645  return __pyx_r;
8646 }
8647 
8648 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8649  int __pyx_r;
8650  __Pyx_TraceDeclarations
8651  __Pyx_RefNannyDeclarations
8652  PyObject *__pyx_t_1 = NULL;
8653  int __pyx_lineno = 0;
8654  const char *__pyx_filename = NULL;
8655  int __pyx_clineno = 0;
8656  __Pyx_RefNannySetupContext("__setitem__", 0);
8657  __Pyx_TraceCall("__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
8658 
8659  /* "View.MemoryView":241
8660  *
8661  * def __setitem__(self, item, value):
8662  * self.memview[item] = value # <<<<<<<<<<<<<<
8663  *
8664  *
8665  */
8666  __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
8667  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
8668  __Pyx_GOTREF(__pyx_t_1);
8669  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
8670  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8671 
8672  /* "View.MemoryView":240
8673  * return self.memview[item]
8674  *
8675  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8676  * self.memview[item] = value
8677  *
8678  */
8679 
8680  /* function exit code */
8681  __pyx_r = 0;
8682  goto __pyx_L0;
8683  __pyx_L1_error:;
8684  __Pyx_XDECREF(__pyx_t_1);
8685  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8686  __pyx_r = -1;
8687  __pyx_L0:;
8688  __Pyx_TraceReturn(Py_None, 0);
8689  __Pyx_RefNannyFinishContext();
8690  return __pyx_r;
8691 }
8692 
8693 /* "(tree fragment)":1
8694  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8695  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8696  * def __setstate_cython__(self, __pyx_state):
8697  */
8698 
8699 /* Python wrapper */
8700 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8701 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8702 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8703  PyObject *__pyx_r = 0;
8704  __Pyx_RefNannyDeclarations
8705  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8706  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
8707 
8708  /* function exit code */
8709  __Pyx_RefNannyFinishContext();
8710  return __pyx_r;
8711 }
8712 
8713 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
8714  PyObject *__pyx_r = NULL;
8715  __Pyx_TraceDeclarations
8716  __Pyx_RefNannyDeclarations
8717  PyObject *__pyx_t_1 = NULL;
8718  int __pyx_lineno = 0;
8719  const char *__pyx_filename = NULL;
8720  int __pyx_clineno = 0;
8721  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8722  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8723 
8724  /* "(tree fragment)":2
8725  * def __reduce_cython__(self):
8726  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8727  * def __setstate_cython__(self, __pyx_state):
8728  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8729  */
8730  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8731  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8732  __Pyx_GOTREF(__pyx_t_1);
8733  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8734  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8735  __PYX_ERR(1, 2, __pyx_L1_error)
8736 
8737  /* "(tree fragment)":1
8738  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8739  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8740  * def __setstate_cython__(self, __pyx_state):
8741  */
8742 
8743  /* function exit code */
8744  __pyx_L1_error:;
8745  __Pyx_XDECREF(__pyx_t_1);
8746  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8747  __pyx_r = NULL;
8748  __Pyx_XGIVEREF(__pyx_r);
8749  __Pyx_TraceReturn(__pyx_r, 0);
8750  __Pyx_RefNannyFinishContext();
8751  return __pyx_r;
8752 }
8753 
8754 /* "(tree fragment)":3
8755  * def __reduce_cython__(self):
8756  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8757  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8758  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8759  */
8760 
8761 /* Python wrapper */
8762 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8763 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8764 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8765  PyObject *__pyx_r = 0;
8766  __Pyx_RefNannyDeclarations
8767  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8768  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8769 
8770  /* function exit code */
8771  __Pyx_RefNannyFinishContext();
8772  return __pyx_r;
8773 }
8774 
8775 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8776  PyObject *__pyx_r = NULL;
8777  __Pyx_TraceDeclarations
8778  __Pyx_RefNannyDeclarations
8779  PyObject *__pyx_t_1 = NULL;
8780  int __pyx_lineno = 0;
8781  const char *__pyx_filename = NULL;
8782  int __pyx_clineno = 0;
8783  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8784  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8785 
8786  /* "(tree fragment)":4
8787  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8788  * def __setstate_cython__(self, __pyx_state):
8789  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8790  */
8791  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8792  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8793  __Pyx_GOTREF(__pyx_t_1);
8794  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8795  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8796  __PYX_ERR(1, 4, __pyx_L1_error)
8797 
8798  /* "(tree fragment)":3
8799  * def __reduce_cython__(self):
8800  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8801  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8802  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8803  */
8804 
8805  /* function exit code */
8806  __pyx_L1_error:;
8807  __Pyx_XDECREF(__pyx_t_1);
8808  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8809  __pyx_r = NULL;
8810  __Pyx_XGIVEREF(__pyx_r);
8811  __Pyx_TraceReturn(__pyx_r, 0);
8812  __Pyx_RefNannyFinishContext();
8813  return __pyx_r;
8814 }
8815 
8816 /* "View.MemoryView":245
8817  *
8818  * @cname("__pyx_array_new")
8819  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8820  * char *mode, char *buf):
8821  * cdef array result
8822  */
8823 
8824 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
8825  struct __pyx_array_obj *__pyx_v_result = 0;
8826  struct __pyx_array_obj *__pyx_r = NULL;
8827  __Pyx_TraceDeclarations
8828  __Pyx_RefNannyDeclarations
8829  int __pyx_t_1;
8830  PyObject *__pyx_t_2 = NULL;
8831  PyObject *__pyx_t_3 = NULL;
8832  PyObject *__pyx_t_4 = NULL;
8833  PyObject *__pyx_t_5 = NULL;
8834  int __pyx_lineno = 0;
8835  const char *__pyx_filename = NULL;
8836  int __pyx_clineno = 0;
8837  __Pyx_RefNannySetupContext("array_cwrapper", 0);
8838  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
8839 
8840  /* "View.MemoryView":249
8841  * cdef array result
8842  *
8843  * if buf == NULL: # <<<<<<<<<<<<<<
8844  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8845  * else:
8846  */
8847  __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8848  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8849  if (__pyx_t_1) {
8850 
8851  /* "View.MemoryView":250
8852  *
8853  * if buf == NULL:
8854  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
8855  * else:
8856  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8857  */
8858  __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
8859  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
8860  __Pyx_GOTREF(__pyx_t_2);
8861  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
8862  __Pyx_GOTREF(__pyx_t_3);
8863  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8864  __Pyx_GOTREF(__pyx_t_4);
8865  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
8866  __Pyx_GOTREF(__pyx_t_5);
8867  __Pyx_INCREF(__pyx_v_shape);
8868  __Pyx_GIVEREF(__pyx_v_shape);
8869  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8870  __Pyx_GIVEREF(__pyx_t_2);
8871  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8872  __Pyx_GIVEREF(__pyx_t_3);
8873  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8874  __Pyx_GIVEREF(__pyx_t_4);
8875  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8876  __pyx_t_2 = 0;
8877  __pyx_t_3 = 0;
8878  __pyx_t_4 = 0;
8879  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8880  __Pyx_GOTREF(__pyx_t_4);
8881  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8882  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
8883  __pyx_t_4 = 0;
8884 
8885  /* "View.MemoryView":249
8886  * cdef array result
8887  *
8888  * if buf == NULL: # <<<<<<<<<<<<<<
8889  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8890  * else:
8891  */
8892  goto __pyx_L3;
8893  }
8894 
8895  /* "View.MemoryView":252
8896  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8897  * else:
8898  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8899  * allocate_buffer=False)
8900  * result.data = buf
8901  */
8902  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8903  /*else*/ {
8904  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
8905  __Pyx_GOTREF(__pyx_t_4);
8906  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8907  __Pyx_GOTREF(__pyx_t_5);
8908  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8909  __Pyx_GOTREF(__pyx_t_3);
8910  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
8911  __Pyx_GOTREF(__pyx_t_2);
8912  __Pyx_INCREF(__pyx_v_shape);
8913  __Pyx_GIVEREF(__pyx_v_shape);
8914  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8915  __Pyx_GIVEREF(__pyx_t_4);
8916  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8917  __Pyx_GIVEREF(__pyx_t_5);
8918  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8919  __Pyx_GIVEREF(__pyx_t_3);
8920  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8921  __pyx_t_4 = 0;
8922  __pyx_t_5 = 0;
8923  __pyx_t_3 = 0;
8924 
8925  /* "View.MemoryView":253
8926  * else:
8927  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8928  * allocate_buffer=False) # <<<<<<<<<<<<<<
8929  * result.data = buf
8930  *
8931  */
8932  __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
8933  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
8934  __Pyx_GOTREF(__pyx_t_3);
8935  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
8936 
8937  /* "View.MemoryView":252
8938  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8939  * else:
8940  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8941  * allocate_buffer=False)
8942  * result.data = buf
8943  */
8944  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8945  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8946  __Pyx_GOTREF(__pyx_t_5);
8947  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8948  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8949  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
8950  __pyx_t_5 = 0;
8951 
8952  /* "View.MemoryView":254
8953  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8954  * allocate_buffer=False)
8955  * result.data = buf # <<<<<<<<<<<<<<
8956  *
8957  * return result
8958  */
8959  __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
8960  __pyx_v_result->data = __pyx_v_buf;
8961  }
8962  __pyx_L3:;
8963 
8964  /* "View.MemoryView":256
8965  * result.data = buf
8966  *
8967  * return result # <<<<<<<<<<<<<<
8968  *
8969  *
8970  */
8971  __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
8972  __Pyx_XDECREF(((PyObject *)__pyx_r));
8973  __Pyx_INCREF(((PyObject *)__pyx_v_result));
8974  __pyx_r = __pyx_v_result;
8975  goto __pyx_L0;
8976 
8977  /* "View.MemoryView":245
8978  *
8979  * @cname("__pyx_array_new")
8980  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8981  * char *mode, char *buf):
8982  * cdef array result
8983  */
8984 
8985  /* function exit code */
8986  __pyx_L1_error:;
8987  __Pyx_XDECREF(__pyx_t_2);
8988  __Pyx_XDECREF(__pyx_t_3);
8989  __Pyx_XDECREF(__pyx_t_4);
8990  __Pyx_XDECREF(__pyx_t_5);
8991  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8992  __pyx_r = 0;
8993  __pyx_L0:;
8994  __Pyx_XDECREF((PyObject *)__pyx_v_result);
8995  __Pyx_XGIVEREF((PyObject *)__pyx_r);
8996  __Pyx_TraceReturn(__pyx_r, 0);
8997  __Pyx_RefNannyFinishContext();
8998  return __pyx_r;
8999 }
9000 
9001 /* "View.MemoryView":282
9002  * cdef class Enum(object):
9003  * cdef object name
9004  * def __init__(self, name): # <<<<<<<<<<<<<<
9005  * self.name = name
9006  * def __repr__(self):
9007  */
9008 
9009 /* Python wrapper */
9010 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9011 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9012  PyObject *__pyx_v_name = 0;
9013  int __pyx_lineno = 0;
9014  const char *__pyx_filename = NULL;
9015  int __pyx_clineno = 0;
9016  int __pyx_r;
9017  __Pyx_RefNannyDeclarations
9018  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9019  {
9020  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9021  PyObject* values[1] = {0};
9022  if (unlikely(__pyx_kwds)) {
9023  Py_ssize_t kw_args;
9024  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9025  switch (pos_args) {
9026  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9027  CYTHON_FALLTHROUGH;
9028  case 0: break;
9029  default: goto __pyx_L5_argtuple_error;
9030  }
9031  kw_args = PyDict_Size(__pyx_kwds);
9032  switch (pos_args) {
9033  case 0:
9034  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9035  else goto __pyx_L5_argtuple_error;
9036  }
9037  if (unlikely(kw_args > 0)) {
9038  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
9039  }
9040  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9041  goto __pyx_L5_argtuple_error;
9042  } else {
9043  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9044  }
9045  __pyx_v_name = values[0];
9046  }
9047  goto __pyx_L4_argument_unpacking_done;
9048  __pyx_L5_argtuple_error:;
9049  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
9050  __pyx_L3_error:;
9051  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9052  __Pyx_RefNannyFinishContext();
9053  return -1;
9054  __pyx_L4_argument_unpacking_done:;
9055  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9056 
9057  /* function exit code */
9058  __Pyx_RefNannyFinishContext();
9059  return __pyx_r;
9060 }
9061 
9062 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9063  int __pyx_r;
9064  __Pyx_TraceDeclarations
9065  __Pyx_RefNannyDeclarations
9066  int __pyx_lineno = 0;
9067  const char *__pyx_filename = NULL;
9068  int __pyx_clineno = 0;
9069  __Pyx_RefNannySetupContext("__init__", 0);
9070  __Pyx_TraceCall("__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
9071 
9072  /* "View.MemoryView":283
9073  * cdef object name
9074  * def __init__(self, name):
9075  * self.name = name # <<<<<<<<<<<<<<
9076  * def __repr__(self):
9077  * return self.name
9078  */
9079  __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
9080  __Pyx_INCREF(__pyx_v_name);
9081  __Pyx_GIVEREF(__pyx_v_name);
9082  __Pyx_GOTREF(__pyx_v_self->name);
9083  __Pyx_DECREF(__pyx_v_self->name);
9084  __pyx_v_self->name = __pyx_v_name;
9085 
9086  /* "View.MemoryView":282
9087  * cdef class Enum(object):
9088  * cdef object name
9089  * def __init__(self, name): # <<<<<<<<<<<<<<
9090  * self.name = name
9091  * def __repr__(self):
9092  */
9093 
9094  /* function exit code */
9095  __pyx_r = 0;
9096  goto __pyx_L0;
9097  __pyx_L1_error:;
9098  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9099  __pyx_r = -1;
9100  __pyx_L0:;
9101  __Pyx_TraceReturn(Py_None, 0);
9102  __Pyx_RefNannyFinishContext();
9103  return __pyx_r;
9104 }
9105 
9106 /* "View.MemoryView":284
9107  * def __init__(self, name):
9108  * self.name = name
9109  * def __repr__(self): # <<<<<<<<<<<<<<
9110  * return self.name
9111  *
9112  */
9113 
9114 /* Python wrapper */
9115 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9116 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9117  PyObject *__pyx_r = 0;
9118  __Pyx_RefNannyDeclarations
9119  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9120  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9121 
9122  /* function exit code */
9123  __Pyx_RefNannyFinishContext();
9124  return __pyx_r;
9125 }
9126 
9127 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9128  PyObject *__pyx_r = NULL;
9129  __Pyx_TraceDeclarations
9130  __Pyx_RefNannyDeclarations
9131  int __pyx_lineno = 0;
9132  const char *__pyx_filename = NULL;
9133  int __pyx_clineno = 0;
9134  __Pyx_RefNannySetupContext("__repr__", 0);
9135  __Pyx_TraceCall("__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
9136 
9137  /* "View.MemoryView":285
9138  * self.name = name
9139  * def __repr__(self):
9140  * return self.name # <<<<<<<<<<<<<<
9141  *
9142  * cdef generic = Enum("<strided and direct or indirect>")
9143  */
9144  __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
9145  __Pyx_XDECREF(__pyx_r);
9146  __Pyx_INCREF(__pyx_v_self->name);
9147  __pyx_r = __pyx_v_self->name;
9148  goto __pyx_L0;
9149 
9150  /* "View.MemoryView":284
9151  * def __init__(self, name):
9152  * self.name = name
9153  * def __repr__(self): # <<<<<<<<<<<<<<
9154  * return self.name
9155  *
9156  */
9157 
9158  /* function exit code */
9159  __pyx_L1_error:;
9160  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9161  __pyx_r = NULL;
9162  __pyx_L0:;
9163  __Pyx_XGIVEREF(__pyx_r);
9164  __Pyx_TraceReturn(__pyx_r, 0);
9165  __Pyx_RefNannyFinishContext();
9166  return __pyx_r;
9167 }
9168 
9169 /* "(tree fragment)":1
9170  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9171  * cdef tuple state
9172  * cdef object _dict
9173  */
9174 
9175 /* Python wrapper */
9176 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9177 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9178 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9179  PyObject *__pyx_r = 0;
9180  __Pyx_RefNannyDeclarations
9181  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9182  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9183 
9184  /* function exit code */
9185  __Pyx_RefNannyFinishContext();
9186  return __pyx_r;
9187 }
9188 
9189 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9190  PyObject *__pyx_v_state = 0;
9191  PyObject *__pyx_v__dict = 0;
9192  int __pyx_v_use_setstate;
9193  PyObject *__pyx_r = NULL;
9194  __Pyx_TraceDeclarations
9195  __Pyx_RefNannyDeclarations
9196  PyObject *__pyx_t_1 = NULL;
9197  int __pyx_t_2;
9198  int __pyx_t_3;
9199  PyObject *__pyx_t_4 = NULL;
9200  PyObject *__pyx_t_5 = NULL;
9201  int __pyx_lineno = 0;
9202  const char *__pyx_filename = NULL;
9203  int __pyx_clineno = 0;
9204  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9205  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9206 
9207  /* "(tree fragment)":5
9208  * cdef object _dict
9209  * cdef bint use_setstate
9210  * state = (self.name,) # <<<<<<<<<<<<<<
9211  * _dict = getattr(self, '__dict__', None)
9212  * if _dict is not None:
9213  */
9214  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
9215  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9216  __Pyx_GOTREF(__pyx_t_1);
9217  __Pyx_INCREF(__pyx_v_self->name);
9218  __Pyx_GIVEREF(__pyx_v_self->name);
9219  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9220  __pyx_v_state = ((PyObject*)__pyx_t_1);
9221  __pyx_t_1 = 0;
9222 
9223  /* "(tree fragment)":6
9224  * cdef bint use_setstate
9225  * state = (self.name,)
9226  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9227  * if _dict is not None:
9228  * state += (_dict,)
9229  */
9230  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
9231  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9232  __Pyx_GOTREF(__pyx_t_1);
9233  __pyx_v__dict = __pyx_t_1;
9234  __pyx_t_1 = 0;
9235 
9236  /* "(tree fragment)":7
9237  * state = (self.name,)
9238  * _dict = getattr(self, '__dict__', None)
9239  * if _dict is not None: # <<<<<<<<<<<<<<
9240  * state += (_dict,)
9241  * use_setstate = True
9242  */
9243  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
9244  __pyx_t_2 = (__pyx_v__dict != Py_None);
9245  __pyx_t_3 = (__pyx_t_2 != 0);
9246  if (__pyx_t_3) {
9247 
9248  /* "(tree fragment)":8
9249  * _dict = getattr(self, '__dict__', None)
9250  * if _dict is not None:
9251  * state += (_dict,) # <<<<<<<<<<<<<<
9252  * use_setstate = True
9253  * else:
9254  */
9255  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
9256  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9257  __Pyx_GOTREF(__pyx_t_1);
9258  __Pyx_INCREF(__pyx_v__dict);
9259  __Pyx_GIVEREF(__pyx_v__dict);
9260  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9261  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9262  __Pyx_GOTREF(__pyx_t_4);
9263  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9264  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9265  __pyx_t_4 = 0;
9266 
9267  /* "(tree fragment)":9
9268  * if _dict is not None:
9269  * state += (_dict,)
9270  * use_setstate = True # <<<<<<<<<<<<<<
9271  * else:
9272  * use_setstate = self.name is not None
9273  */
9274  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
9275  __pyx_v_use_setstate = 1;
9276 
9277  /* "(tree fragment)":7
9278  * state = (self.name,)
9279  * _dict = getattr(self, '__dict__', None)
9280  * if _dict is not None: # <<<<<<<<<<<<<<
9281  * state += (_dict,)
9282  * use_setstate = True
9283  */
9284  goto __pyx_L3;
9285  }
9286 
9287  /* "(tree fragment)":11
9288  * use_setstate = True
9289  * else:
9290  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9291  * if use_setstate:
9292  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9293  */
9294  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
9295  /*else*/ {
9296  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9297  __pyx_v_use_setstate = __pyx_t_3;
9298  }
9299  __pyx_L3:;
9300 
9301  /* "(tree fragment)":12
9302  * else:
9303  * use_setstate = self.name is not None
9304  * if use_setstate: # <<<<<<<<<<<<<<
9305  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9306  * else:
9307  */
9308  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
9309  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9310  if (__pyx_t_3) {
9311 
9312  /* "(tree fragment)":13
9313  * use_setstate = self.name is not None
9314  * if use_setstate:
9315  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9316  * else:
9317  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9318  */
9319  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
9320  __Pyx_XDECREF(__pyx_r);
9321  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9322  __Pyx_GOTREF(__pyx_t_4);
9323  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9324  __Pyx_GOTREF(__pyx_t_1);
9325  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9326  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9327  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9328  __Pyx_INCREF(__pyx_int_184977713);
9329  __Pyx_GIVEREF(__pyx_int_184977713);
9330  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9331  __Pyx_INCREF(Py_None);
9332  __Pyx_GIVEREF(Py_None);
9333  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9334  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9335  __Pyx_GOTREF(__pyx_t_5);
9336  __Pyx_GIVEREF(__pyx_t_4);
9337  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9338  __Pyx_GIVEREF(__pyx_t_1);
9339  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9340  __Pyx_INCREF(__pyx_v_state);
9341  __Pyx_GIVEREF(__pyx_v_state);
9342  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9343  __pyx_t_4 = 0;
9344  __pyx_t_1 = 0;
9345  __pyx_r = __pyx_t_5;
9346  __pyx_t_5 = 0;
9347  goto __pyx_L0;
9348 
9349  /* "(tree fragment)":12
9350  * else:
9351  * use_setstate = self.name is not None
9352  * if use_setstate: # <<<<<<<<<<<<<<
9353  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9354  * else:
9355  */
9356  }
9357 
9358  /* "(tree fragment)":15
9359  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9360  * else:
9361  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9362  * def __setstate_cython__(self, __pyx_state):
9363  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9364  */
9365  __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
9366  /*else*/ {
9367  __Pyx_XDECREF(__pyx_r);
9368  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9369  __Pyx_GOTREF(__pyx_t_5);
9370  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9371  __Pyx_GOTREF(__pyx_t_1);
9372  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9373  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9374  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9375  __Pyx_INCREF(__pyx_int_184977713);
9376  __Pyx_GIVEREF(__pyx_int_184977713);
9377  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9378  __Pyx_INCREF(__pyx_v_state);
9379  __Pyx_GIVEREF(__pyx_v_state);
9380  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9381  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9382  __Pyx_GOTREF(__pyx_t_4);
9383  __Pyx_GIVEREF(__pyx_t_5);
9384  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9385  __Pyx_GIVEREF(__pyx_t_1);
9386  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9387  __pyx_t_5 = 0;
9388  __pyx_t_1 = 0;
9389  __pyx_r = __pyx_t_4;
9390  __pyx_t_4 = 0;
9391  goto __pyx_L0;
9392  }
9393 
9394  /* "(tree fragment)":1
9395  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9396  * cdef tuple state
9397  * cdef object _dict
9398  */
9399 
9400  /* function exit code */
9401  __pyx_L1_error:;
9402  __Pyx_XDECREF(__pyx_t_1);
9403  __Pyx_XDECREF(__pyx_t_4);
9404  __Pyx_XDECREF(__pyx_t_5);
9405  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9406  __pyx_r = NULL;
9407  __pyx_L0:;
9408  __Pyx_XDECREF(__pyx_v_state);
9409  __Pyx_XDECREF(__pyx_v__dict);
9410  __Pyx_XGIVEREF(__pyx_r);
9411  __Pyx_TraceReturn(__pyx_r, 0);
9412  __Pyx_RefNannyFinishContext();
9413  return __pyx_r;
9414 }
9415 
9416 /* "(tree fragment)":16
9417  * else:
9418  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9419  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9420  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9421  */
9422 
9423 /* Python wrapper */
9424 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9425 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9426 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9427  PyObject *__pyx_r = 0;
9428  __Pyx_RefNannyDeclarations
9429  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9430  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9431 
9432  /* function exit code */
9433  __Pyx_RefNannyFinishContext();
9434  return __pyx_r;
9435 }
9436 
9437 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9438  PyObject *__pyx_r = NULL;
9439  __Pyx_TraceDeclarations
9440  __Pyx_RefNannyDeclarations
9441  PyObject *__pyx_t_1 = NULL;
9442  int __pyx_lineno = 0;
9443  const char *__pyx_filename = NULL;
9444  int __pyx_clineno = 0;
9445  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9446  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
9447 
9448  /* "(tree fragment)":17
9449  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9450  * def __setstate_cython__(self, __pyx_state):
9451  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
9452  */
9453  __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
9454  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9455  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9456  __Pyx_GOTREF(__pyx_t_1);
9457  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9458 
9459  /* "(tree fragment)":16
9460  * else:
9461  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9462  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9463  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9464  */
9465 
9466  /* function exit code */
9467  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9468  goto __pyx_L0;
9469  __pyx_L1_error:;
9470  __Pyx_XDECREF(__pyx_t_1);
9471  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9472  __pyx_r = NULL;
9473  __pyx_L0:;
9474  __Pyx_XGIVEREF(__pyx_r);
9475  __Pyx_TraceReturn(__pyx_r, 0);
9476  __Pyx_RefNannyFinishContext();
9477  return __pyx_r;
9478 }
9479 
9480 /* "View.MemoryView":299
9481  *
9482  * @cname('__pyx_align_pointer')
9483  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9484  * "Align pointer memory on a given boundary"
9485  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9486  */
9487 
9488 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
9489  Py_intptr_t __pyx_v_aligned_p;
9490  size_t __pyx_v_offset;
9491  void *__pyx_r;
9492  __Pyx_TraceDeclarations
9493  int __pyx_t_1;
9494  int __pyx_lineno = 0;
9495  const char *__pyx_filename = NULL;
9496  int __pyx_clineno = 0;
9497  __Pyx_TraceCall("align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
9498 
9499  /* "View.MemoryView":301
9500  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9501  * "Align pointer memory on a given boundary"
9502  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
9503  * cdef size_t offset
9504  *
9505  */
9506  __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
9507  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9508 
9509  /* "View.MemoryView":305
9510  *
9511  * with cython.cdivision(True):
9512  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
9513  *
9514  * if offset > 0:
9515  */
9516  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9517 
9518  /* "View.MemoryView":307
9519  * offset = aligned_p % alignment
9520  *
9521  * if offset > 0: # <<<<<<<<<<<<<<
9522  * aligned_p += alignment - offset
9523  *
9524  */
9525  __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
9526  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9527  if (__pyx_t_1) {
9528 
9529  /* "View.MemoryView":308
9530  *
9531  * if offset > 0:
9532  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
9533  *
9534  * return <void *> aligned_p
9535  */
9536  __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
9537  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9538 
9539  /* "View.MemoryView":307
9540  * offset = aligned_p % alignment
9541  *
9542  * if offset > 0: # <<<<<<<<<<<<<<
9543  * aligned_p += alignment - offset
9544  *
9545  */
9546  }
9547 
9548  /* "View.MemoryView":310
9549  * aligned_p += alignment - offset
9550  *
9551  * return <void *> aligned_p # <<<<<<<<<<<<<<
9552  *
9553  *
9554  */
9555  __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
9556  __pyx_r = ((void *)__pyx_v_aligned_p);
9557  goto __pyx_L0;
9558 
9559  /* "View.MemoryView":299
9560  *
9561  * @cname('__pyx_align_pointer')
9562  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9563  * "Align pointer memory on a given boundary"
9564  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9565  */
9566 
9567  /* function exit code */
9568  __pyx_L1_error:;
9569  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
9570  __pyx_r = 0;
9571  __pyx_L0:;
9572  __Pyx_TraceReturn(Py_None, 1);
9573  return __pyx_r;
9574 }
9575 
9576 /* "View.MemoryView":346
9577  * cdef __Pyx_TypeInfo *typeinfo
9578  *
9579  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9580  * self.obj = obj
9581  * self.flags = flags
9582  */
9583 
9584 /* Python wrapper */
9585 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9586 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9587  PyObject *__pyx_v_obj = 0;
9588  int __pyx_v_flags;
9589  int __pyx_v_dtype_is_object;
9590  int __pyx_lineno = 0;
9591  const char *__pyx_filename = NULL;
9592  int __pyx_clineno = 0;
9593  int __pyx_r;
9594  __Pyx_RefNannyDeclarations
9595  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9596  {
9597  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9598  PyObject* values[3] = {0,0,0};
9599  if (unlikely(__pyx_kwds)) {
9600  Py_ssize_t kw_args;
9601  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9602  switch (pos_args) {
9603  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9604  CYTHON_FALLTHROUGH;
9605  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9606  CYTHON_FALLTHROUGH;
9607  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9608  CYTHON_FALLTHROUGH;
9609  case 0: break;
9610  default: goto __pyx_L5_argtuple_error;
9611  }
9612  kw_args = PyDict_Size(__pyx_kwds);
9613  switch (pos_args) {
9614  case 0:
9615  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9616  else goto __pyx_L5_argtuple_error;
9617  CYTHON_FALLTHROUGH;
9618  case 1:
9619  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9620  else {
9621  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
9622  }
9623  CYTHON_FALLTHROUGH;
9624  case 2:
9625  if (kw_args > 0) {
9626  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9627  if (value) { values[2] = value; kw_args--; }
9628  }
9629  }
9630  if (unlikely(kw_args > 0)) {
9631  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
9632  }
9633  } else {
9634  switch (PyTuple_GET_SIZE(__pyx_args)) {
9635  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9636  CYTHON_FALLTHROUGH;
9637  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9638  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9639  break;
9640  default: goto __pyx_L5_argtuple_error;
9641  }
9642  }
9643  __pyx_v_obj = values[0];
9644  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9645  if (values[2]) {
9646  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9647  } else {
9648  __pyx_v_dtype_is_object = ((int)0);
9649  }
9650  }
9651  goto __pyx_L4_argument_unpacking_done;
9652  __pyx_L5_argtuple_error:;
9653  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
9654  __pyx_L3_error:;
9655  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9656  __Pyx_RefNannyFinishContext();
9657  return -1;
9658  __pyx_L4_argument_unpacking_done:;
9659  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9660 
9661  /* function exit code */
9662  __Pyx_RefNannyFinishContext();
9663  return __pyx_r;
9664 }
9665 
9666 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
9667  int __pyx_r;
9668  __Pyx_TraceDeclarations
9669  __Pyx_RefNannyDeclarations
9670  int __pyx_t_1;
9671  int __pyx_t_2;
9672  int __pyx_t_3;
9673  int __pyx_t_4;
9674  int __pyx_lineno = 0;
9675  const char *__pyx_filename = NULL;
9676  int __pyx_clineno = 0;
9677  __Pyx_RefNannySetupContext("__cinit__", 0);
9678  __Pyx_TraceCall("__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
9679 
9680  /* "View.MemoryView":347
9681  *
9682  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9683  * self.obj = obj # <<<<<<<<<<<<<<
9684  * self.flags = flags
9685  * if type(self) is memoryview or obj is not None:
9686  */
9687  __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9688  __Pyx_INCREF(__pyx_v_obj);
9689  __Pyx_GIVEREF(__pyx_v_obj);
9690  __Pyx_GOTREF(__pyx_v_self->obj);
9691  __Pyx_DECREF(__pyx_v_self->obj);
9692  __pyx_v_self->obj = __pyx_v_obj;
9693 
9694  /* "View.MemoryView":348
9695  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9696  * self.obj = obj
9697  * self.flags = flags # <<<<<<<<<<<<<<
9698  * if type(self) is memoryview or obj is not None:
9699  * __Pyx_GetBuffer(obj, &self.view, flags)
9700  */
9701  __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9702  __pyx_v_self->flags = __pyx_v_flags;
9703 
9704  /* "View.MemoryView":349
9705  * self.obj = obj
9706  * self.flags = flags
9707  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9708  * __Pyx_GetBuffer(obj, &self.view, flags)
9709  * if <PyObject *> self.view.obj == NULL:
9710  */
9711  __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9712  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9713  __pyx_t_3 = (__pyx_t_2 != 0);
9714  if (!__pyx_t_3) {
9715  } else {
9716  __pyx_t_1 = __pyx_t_3;
9717  goto __pyx_L4_bool_binop_done;
9718  }
9719  __pyx_t_3 = (__pyx_v_obj != Py_None);
9720  __pyx_t_2 = (__pyx_t_3 != 0);
9721  __pyx_t_1 = __pyx_t_2;
9722  __pyx_L4_bool_binop_done:;
9723  if (__pyx_t_1) {
9724 
9725  /* "View.MemoryView":350
9726  * self.flags = flags
9727  * if type(self) is memoryview or obj is not None:
9728  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
9729  * if <PyObject *> self.view.obj == NULL:
9730  * (<__pyx_buffer *> &self.view).obj = Py_None
9731  */
9732  __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9733  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
9734 
9735  /* "View.MemoryView":351
9736  * if type(self) is memoryview or obj is not None:
9737  * __Pyx_GetBuffer(obj, &self.view, flags)
9738  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9739  * (<__pyx_buffer *> &self.view).obj = Py_None
9740  * Py_INCREF(Py_None)
9741  */
9742  __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9743  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9744  if (__pyx_t_1) {
9745 
9746  /* "View.MemoryView":352
9747  * __Pyx_GetBuffer(obj, &self.view, flags)
9748  * if <PyObject *> self.view.obj == NULL:
9749  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
9750  * Py_INCREF(Py_None)
9751  *
9752  */
9753  __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9754  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9755 
9756  /* "View.MemoryView":353
9757  * if <PyObject *> self.view.obj == NULL:
9758  * (<__pyx_buffer *> &self.view).obj = Py_None
9759  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9760  *
9761  * if not __PYX_CYTHON_ATOMICS_ENABLED():
9762  */
9763  __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
9764  Py_INCREF(Py_None);
9765 
9766  /* "View.MemoryView":351
9767  * if type(self) is memoryview or obj is not None:
9768  * __Pyx_GetBuffer(obj, &self.view, flags)
9769  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9770  * (<__pyx_buffer *> &self.view).obj = Py_None
9771  * Py_INCREF(Py_None)
9772  */
9773  }
9774 
9775  /* "View.MemoryView":349
9776  * self.obj = obj
9777  * self.flags = flags
9778  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9779  * __Pyx_GetBuffer(obj, &self.view, flags)
9780  * if <PyObject *> self.view.obj == NULL:
9781  */
9782  }
9783 
9784  /* "View.MemoryView":355
9785  * Py_INCREF(Py_None)
9786  *
9787  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
9788  * global __pyx_memoryview_thread_locks_used
9789  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9790  */
9791  __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9792  __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
9793  if (__pyx_t_1) {
9794 
9795  /* "View.MemoryView":357
9796  * if not __PYX_CYTHON_ATOMICS_ENABLED():
9797  * global __pyx_memoryview_thread_locks_used
9798  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9799  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9800  * __pyx_memoryview_thread_locks_used += 1
9801  */
9802  __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9803  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9804  if (__pyx_t_1) {
9805 
9806  /* "View.MemoryView":358
9807  * global __pyx_memoryview_thread_locks_used
9808  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9809  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
9810  * __pyx_memoryview_thread_locks_used += 1
9811  * if self.lock is NULL:
9812  */
9813  __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9814  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9815 
9816  /* "View.MemoryView":359
9817  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9818  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9819  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
9820  * if self.lock is NULL:
9821  * self.lock = PyThread_allocate_lock()
9822  */
9823  __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9824  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9825 
9826  /* "View.MemoryView":357
9827  * if not __PYX_CYTHON_ATOMICS_ENABLED():
9828  * global __pyx_memoryview_thread_locks_used
9829  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9830  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9831  * __pyx_memoryview_thread_locks_used += 1
9832  */
9833  }
9834 
9835  /* "View.MemoryView":360
9836  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9837  * __pyx_memoryview_thread_locks_used += 1
9838  * if self.lock is NULL: # <<<<<<<<<<<<<<
9839  * self.lock = PyThread_allocate_lock()
9840  * if self.lock is NULL:
9841  */
9842  __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9843  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9844  if (__pyx_t_1) {
9845 
9846  /* "View.MemoryView":361
9847  * __pyx_memoryview_thread_locks_used += 1
9848  * if self.lock is NULL:
9849  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
9850  * if self.lock is NULL:
9851  * raise MemoryError
9852  */
9853  __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9854  __pyx_v_self->lock = PyThread_allocate_lock();
9855 
9856  /* "View.MemoryView":362
9857  * if self.lock is NULL:
9858  * self.lock = PyThread_allocate_lock()
9859  * if self.lock is NULL: # <<<<<<<<<<<<<<
9860  * raise MemoryError
9861  *
9862  */
9863  __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
9864  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9865  if (unlikely(__pyx_t_1)) {
9866 
9867  /* "View.MemoryView":363
9868  * self.lock = PyThread_allocate_lock()
9869  * if self.lock is NULL:
9870  * raise MemoryError # <<<<<<<<<<<<<<
9871  *
9872  * if flags & PyBUF_FORMAT:
9873  */
9874  __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9875  PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
9876 
9877  /* "View.MemoryView":362
9878  * if self.lock is NULL:
9879  * self.lock = PyThread_allocate_lock()
9880  * if self.lock is NULL: # <<<<<<<<<<<<<<
9881  * raise MemoryError
9882  *
9883  */
9884  }
9885 
9886  /* "View.MemoryView":360
9887  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9888  * __pyx_memoryview_thread_locks_used += 1
9889  * if self.lock is NULL: # <<<<<<<<<<<<<<
9890  * self.lock = PyThread_allocate_lock()
9891  * if self.lock is NULL:
9892  */
9893  }
9894 
9895  /* "View.MemoryView":355
9896  * Py_INCREF(Py_None)
9897  *
9898  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
9899  * global __pyx_memoryview_thread_locks_used
9900  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9901  */
9902  }
9903 
9904  /* "View.MemoryView":365
9905  * raise MemoryError
9906  *
9907  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9908  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9909  * else:
9910  */
9911  __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
9912  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9913  if (__pyx_t_1) {
9914 
9915  /* "View.MemoryView":366
9916  *
9917  * if flags & PyBUF_FORMAT:
9918  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
9919  * else:
9920  * self.dtype_is_object = dtype_is_object
9921  */
9922  __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
9923  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
9924  if (__pyx_t_2) {
9925  } else {
9926  __pyx_t_1 = __pyx_t_2;
9927  goto __pyx_L12_bool_binop_done;
9928  }
9929  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
9930  __pyx_t_1 = __pyx_t_2;
9931  __pyx_L12_bool_binop_done:;
9932  __pyx_v_self->dtype_is_object = __pyx_t_1;
9933 
9934  /* "View.MemoryView":365
9935  * raise MemoryError
9936  *
9937  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9938  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9939  * else:
9940  */
9941  goto __pyx_L11;
9942  }
9943 
9944  /* "View.MemoryView":368
9945  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9946  * else:
9947  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
9948  *
9949  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9950  */
9951  __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
9952  /*else*/ {
9953  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9954  }
9955  __pyx_L11:;
9956 
9957  /* "View.MemoryView":370
9958  * self.dtype_is_object = dtype_is_object
9959  *
9960  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
9961  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9962  * self.typeinfo = NULL
9963  */
9964  __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
9965  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
9966 
9967  /* "View.MemoryView":372
9968  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9969  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9970  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9971  *
9972  * def __dealloc__(memoryview self):
9973  */
9974  __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
9975  __pyx_v_self->typeinfo = NULL;
9976 
9977  /* "View.MemoryView":346
9978  * cdef __Pyx_TypeInfo *typeinfo
9979  *
9980  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9981  * self.obj = obj
9982  * self.flags = flags
9983  */
9984 
9985  /* function exit code */
9986  __pyx_r = 0;
9987  goto __pyx_L0;
9988  __pyx_L1_error:;
9989  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9990  __pyx_r = -1;
9991  __pyx_L0:;
9992  __Pyx_TraceReturn(Py_None, 0);
9993  __Pyx_RefNannyFinishContext();
9994  return __pyx_r;
9995 }
9996 
9997 /* "View.MemoryView":374
9998  * self.typeinfo = NULL
9999  *
10000  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10001  * if self.obj is not None:
10002  * __Pyx_ReleaseBuffer(&self.view)
10003  */
10004 
10005 /* Python wrapper */
10006 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10007 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10008  __Pyx_RefNannyDeclarations
10009  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10010  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10011 
10012  /* function exit code */
10013  __Pyx_RefNannyFinishContext();
10014 }
10015 
10016 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10017  int __pyx_v_i;
10018  __Pyx_TraceDeclarations
10019  __Pyx_RefNannyDeclarations
10020  int __pyx_t_1;
10021  int __pyx_t_2;
10022  int __pyx_t_3;
10023  int __pyx_t_4;
10024  int __pyx_t_5;
10025  PyThread_type_lock __pyx_t_6;
10026  PyThread_type_lock __pyx_t_7;
10027  int __pyx_lineno = 0;
10028  const char *__pyx_filename = NULL;
10029  int __pyx_clineno = 0;
10030  __Pyx_RefNannySetupContext("__dealloc__", 0);
10031  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
10032 
10033  /* "View.MemoryView":375
10034  *
10035  * def __dealloc__(memoryview self):
10036  * if self.obj is not None: # <<<<<<<<<<<<<<
10037  * __Pyx_ReleaseBuffer(&self.view)
10038  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10039  */
10040  __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
10041  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10042  __pyx_t_2 = (__pyx_t_1 != 0);
10043  if (__pyx_t_2) {
10044 
10045  /* "View.MemoryView":376
10046  * def __dealloc__(memoryview self):
10047  * if self.obj is not None:
10048  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10049  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10050  *
10051  */
10052  __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
10053  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10054 
10055  /* "View.MemoryView":375
10056  *
10057  * def __dealloc__(memoryview self):
10058  * if self.obj is not None: # <<<<<<<<<<<<<<
10059  * __Pyx_ReleaseBuffer(&self.view)
10060  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10061  */
10062  goto __pyx_L3;
10063  }
10064 
10065  /* "View.MemoryView":377
10066  * if self.obj is not None:
10067  * __Pyx_ReleaseBuffer(&self.view)
10068  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10069  *
10070  * (<__pyx_buffer *> &self.view).obj = NULL
10071  */
10072  __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
10073  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10074  if (__pyx_t_2) {
10075 
10076  /* "View.MemoryView":379
10077  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10078  *
10079  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10080  * Py_DECREF(Py_None)
10081  *
10082  */
10083  __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
10084  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10085 
10086  /* "View.MemoryView":380
10087  *
10088  * (<__pyx_buffer *> &self.view).obj = NULL
10089  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10090  *
10091  * cdef int i
10092  */
10093  __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
10094  Py_DECREF(Py_None);
10095 
10096  /* "View.MemoryView":377
10097  * if self.obj is not None:
10098  * __Pyx_ReleaseBuffer(&self.view)
10099  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10100  *
10101  * (<__pyx_buffer *> &self.view).obj = NULL
10102  */
10103  }
10104  __pyx_L3:;
10105 
10106  /* "View.MemoryView":384
10107  * cdef int i
10108  * global __pyx_memoryview_thread_locks_used
10109  * if self.lock != NULL: # <<<<<<<<<<<<<<
10110  * for i in range(__pyx_memoryview_thread_locks_used):
10111  * if __pyx_memoryview_thread_locks[i] is self.lock:
10112  */
10113  __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
10114  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10115  if (__pyx_t_2) {
10116 
10117  /* "View.MemoryView":385
10118  * global __pyx_memoryview_thread_locks_used
10119  * if self.lock != NULL:
10120  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10121  * if __pyx_memoryview_thread_locks[i] is self.lock:
10122  * __pyx_memoryview_thread_locks_used -= 1
10123  */
10124  __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
10125  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10126  __pyx_t_4 = __pyx_t_3;
10127  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10128  __pyx_v_i = __pyx_t_5;
10129 
10130  /* "View.MemoryView":386
10131  * if self.lock != NULL:
10132  * for i in range(__pyx_memoryview_thread_locks_used):
10133  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10134  * __pyx_memoryview_thread_locks_used -= 1
10135  * if i != __pyx_memoryview_thread_locks_used:
10136  */
10137  __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
10138  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10139  if (__pyx_t_2) {
10140 
10141  /* "View.MemoryView":387
10142  * for i in range(__pyx_memoryview_thread_locks_used):
10143  * if __pyx_memoryview_thread_locks[i] is self.lock:
10144  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10145  * if i != __pyx_memoryview_thread_locks_used:
10146  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10147  */
10148  __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
10149  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10150 
10151  /* "View.MemoryView":388
10152  * if __pyx_memoryview_thread_locks[i] is self.lock:
10153  * __pyx_memoryview_thread_locks_used -= 1
10154  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10155  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10156  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10157  */
10158  __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
10159  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10160  if (__pyx_t_2) {
10161 
10162  /* "View.MemoryView":390
10163  * if i != __pyx_memoryview_thread_locks_used:
10164  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10165  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10166  * break
10167  * else:
10168  */
10169  __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
10170  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10171  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10172 
10173  /* "View.MemoryView":389
10174  * __pyx_memoryview_thread_locks_used -= 1
10175  * if i != __pyx_memoryview_thread_locks_used:
10176  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10177  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10178  * break
10179  */
10180  __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
10181  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10182  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10183 
10184  /* "View.MemoryView":388
10185  * if __pyx_memoryview_thread_locks[i] is self.lock:
10186  * __pyx_memoryview_thread_locks_used -= 1
10187  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10188  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10189  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10190  */
10191  }
10192 
10193  /* "View.MemoryView":391
10194  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10195  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10196  * break # <<<<<<<<<<<<<<
10197  * else:
10198  * PyThread_free_lock(self.lock)
10199  */
10200  __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
10201  goto __pyx_L6_break;
10202 
10203  /* "View.MemoryView":386
10204  * if self.lock != NULL:
10205  * for i in range(__pyx_memoryview_thread_locks_used):
10206  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10207  * __pyx_memoryview_thread_locks_used -= 1
10208  * if i != __pyx_memoryview_thread_locks_used:
10209  */
10210  }
10211  }
10212  /*else*/ {
10213 
10214  /* "View.MemoryView":393
10215  * break
10216  * else:
10217  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10218  *
10219  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10220  */
10221  __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
10222  PyThread_free_lock(__pyx_v_self->lock);
10223  }
10224  __pyx_L6_break:;
10225 
10226  /* "View.MemoryView":384
10227  * cdef int i
10228  * global __pyx_memoryview_thread_locks_used
10229  * if self.lock != NULL: # <<<<<<<<<<<<<<
10230  * for i in range(__pyx_memoryview_thread_locks_used):
10231  * if __pyx_memoryview_thread_locks[i] is self.lock:
10232  */
10233  }
10234 
10235  /* "View.MemoryView":374
10236  * self.typeinfo = NULL
10237  *
10238  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10239  * if self.obj is not None:
10240  * __Pyx_ReleaseBuffer(&self.view)
10241  */
10242 
10243  /* function exit code */
10244  goto __pyx_L0;
10245  __pyx_L1_error:;
10246  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10247  __pyx_L0:;
10248  __Pyx_TraceReturn(Py_None, 0);
10249  __Pyx_RefNannyFinishContext();
10250 }
10251 
10252 /* "View.MemoryView":395
10253  * PyThread_free_lock(self.lock)
10254  *
10255  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10256  * cdef Py_ssize_t dim
10257  * cdef char *itemp = <char *> self.view.buf
10258  */
10259 
10260 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10261  Py_ssize_t __pyx_v_dim;
10262  char *__pyx_v_itemp;
10263  PyObject *__pyx_v_idx = NULL;
10264  char *__pyx_r;
10265  __Pyx_TraceDeclarations
10266  __Pyx_RefNannyDeclarations
10267  Py_ssize_t __pyx_t_1;
10268  PyObject *__pyx_t_2 = NULL;
10269  Py_ssize_t __pyx_t_3;
10270  PyObject *(*__pyx_t_4)(PyObject *);
10271  PyObject *__pyx_t_5 = NULL;
10272  Py_ssize_t __pyx_t_6;
10273  char *__pyx_t_7;
10274  int __pyx_lineno = 0;
10275  const char *__pyx_filename = NULL;
10276  int __pyx_clineno = 0;
10277  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10278  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
10279 
10280  /* "View.MemoryView":397
10281  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10282  * cdef Py_ssize_t dim
10283  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10284  *
10285  * for dim, idx in enumerate(index):
10286  */
10287  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10288  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10289 
10290  /* "View.MemoryView":399
10291  * cdef char *itemp = <char *> self.view.buf
10292  *
10293  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10294  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10295  *
10296  */
10297  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10298  __pyx_t_1 = 0;
10299  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10300  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10301  __pyx_t_4 = NULL;
10302  } else {
10303  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
10304  __Pyx_GOTREF(__pyx_t_2);
10305  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
10306  }
10307  for (;;) {
10308  if (likely(!__pyx_t_4)) {
10309  if (likely(PyList_CheckExact(__pyx_t_2))) {
10310  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10311  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10312  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10313  #else
10314  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10315  __Pyx_GOTREF(__pyx_t_5);
10316  #endif
10317  } else {
10318  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10319  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10320  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10321  #else
10322  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10323  __Pyx_GOTREF(__pyx_t_5);
10324  #endif
10325  }
10326  } else {
10327  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10328  if (unlikely(!__pyx_t_5)) {
10329  PyObject* exc_type = PyErr_Occurred();
10330  if (exc_type) {
10331  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10332  else __PYX_ERR(1, 399, __pyx_L1_error)
10333  }
10334  break;
10335  }
10336  __Pyx_GOTREF(__pyx_t_5);
10337  }
10338  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10339  __pyx_t_5 = 0;
10340  __pyx_v_dim = __pyx_t_1;
10341  __pyx_t_1 = (__pyx_t_1 + 1);
10342 
10343  /* "View.MemoryView":400
10344  *
10345  * for dim, idx in enumerate(index):
10346  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10347  *
10348  * return itemp
10349  */
10350  __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
10351  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
10352  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
10353  __pyx_v_itemp = __pyx_t_7;
10354 
10355  /* "View.MemoryView":399
10356  * cdef char *itemp = <char *> self.view.buf
10357  *
10358  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10359  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10360  *
10361  */
10362  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10363  }
10364  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10365 
10366  /* "View.MemoryView":402
10367  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10368  *
10369  * return itemp # <<<<<<<<<<<<<<
10370  *
10371  *
10372  */
10373  __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
10374  __pyx_r = __pyx_v_itemp;
10375  goto __pyx_L0;
10376 
10377  /* "View.MemoryView":395
10378  * PyThread_free_lock(self.lock)
10379  *
10380  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10381  * cdef Py_ssize_t dim
10382  * cdef char *itemp = <char *> self.view.buf
10383  */
10384 
10385  /* function exit code */
10386  __pyx_L1_error:;
10387  __Pyx_XDECREF(__pyx_t_2);
10388  __Pyx_XDECREF(__pyx_t_5);
10389  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10390  __pyx_r = NULL;
10391  __pyx_L0:;
10392  __Pyx_XDECREF(__pyx_v_idx);
10393  __Pyx_TraceReturn(Py_None, 0);
10394  __Pyx_RefNannyFinishContext();
10395  return __pyx_r;
10396 }
10397 
10398 /* "View.MemoryView":405
10399  *
10400  *
10401  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10402  * if index is Ellipsis:
10403  * return self
10404  */
10405 
10406 /* Python wrapper */
10407 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10408 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10409  PyObject *__pyx_r = 0;
10410  __Pyx_RefNannyDeclarations
10411  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10412  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10413 
10414  /* function exit code */
10415  __Pyx_RefNannyFinishContext();
10416  return __pyx_r;
10417 }
10418 
10419 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10420  PyObject *__pyx_v_have_slices = NULL;
10421  PyObject *__pyx_v_indices = NULL;
10422  char *__pyx_v_itemp;
10423  PyObject *__pyx_r = NULL;
10424  __Pyx_TraceDeclarations
10425  __Pyx_RefNannyDeclarations
10426  int __pyx_t_1;
10427  int __pyx_t_2;
10428  PyObject *__pyx_t_3 = NULL;
10429  PyObject *__pyx_t_4 = NULL;
10430  PyObject *__pyx_t_5 = NULL;
10431  char *__pyx_t_6;
10432  int __pyx_lineno = 0;
10433  const char *__pyx_filename = NULL;
10434  int __pyx_clineno = 0;
10435  __Pyx_RefNannySetupContext("__getitem__", 0);
10436  __Pyx_TraceCall("__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
10437 
10438  /* "View.MemoryView":406
10439  *
10440  * def __getitem__(memoryview self, object index):
10441  * if index is Ellipsis: # <<<<<<<<<<<<<<
10442  * return self
10443  *
10444  */
10445  __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
10446  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10447  __pyx_t_2 = (__pyx_t_1 != 0);
10448  if (__pyx_t_2) {
10449 
10450  /* "View.MemoryView":407
10451  * def __getitem__(memoryview self, object index):
10452  * if index is Ellipsis:
10453  * return self # <<<<<<<<<<<<<<
10454  *
10455  * have_slices, indices = _unellipsify(index, self.view.ndim)
10456  */
10457  __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
10458  __Pyx_XDECREF(__pyx_r);
10459  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10460  __pyx_r = ((PyObject *)__pyx_v_self);
10461  goto __pyx_L0;
10462 
10463  /* "View.MemoryView":406
10464  *
10465  * def __getitem__(memoryview self, object index):
10466  * if index is Ellipsis: # <<<<<<<<<<<<<<
10467  * return self
10468  *
10469  */
10470  }
10471 
10472  /* "View.MemoryView":409
10473  * return self
10474  *
10475  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10476  *
10477  * cdef char *itemp
10478  */
10479  __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
10480  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
10481  __Pyx_GOTREF(__pyx_t_3);
10482  if (likely(__pyx_t_3 != Py_None)) {
10483  PyObject* sequence = __pyx_t_3;
10484  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10485  if (unlikely(size != 2)) {
10486  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10487  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10488  __PYX_ERR(1, 409, __pyx_L1_error)
10489  }
10490  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10491  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10492  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10493  __Pyx_INCREF(__pyx_t_4);
10494  __Pyx_INCREF(__pyx_t_5);
10495  #else
10496  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
10497  __Pyx_GOTREF(__pyx_t_4);
10498  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
10499  __Pyx_GOTREF(__pyx_t_5);
10500  #endif
10501  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10502  } else {
10503  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
10504  }
10505  __pyx_v_have_slices = __pyx_t_4;
10506  __pyx_t_4 = 0;
10507  __pyx_v_indices = __pyx_t_5;
10508  __pyx_t_5 = 0;
10509 
10510  /* "View.MemoryView":412
10511  *
10512  * cdef char *itemp
10513  * if have_slices: # <<<<<<<<<<<<<<
10514  * return memview_slice(self, indices)
10515  * else:
10516  */
10517  __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
10518  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
10519  if (__pyx_t_2) {
10520 
10521  /* "View.MemoryView":413
10522  * cdef char *itemp
10523  * if have_slices:
10524  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
10525  * else:
10526  * itemp = self.get_item_pointer(indices)
10527  */
10528  __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
10529  __Pyx_XDECREF(__pyx_r);
10530  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
10531  __Pyx_GOTREF(__pyx_t_3);
10532  __pyx_r = __pyx_t_3;
10533  __pyx_t_3 = 0;
10534  goto __pyx_L0;
10535 
10536  /* "View.MemoryView":412
10537  *
10538  * cdef char *itemp
10539  * if have_slices: # <<<<<<<<<<<<<<
10540  * return memview_slice(self, indices)
10541  * else:
10542  */
10543  }
10544 
10545  /* "View.MemoryView":415
10546  * return memview_slice(self, indices)
10547  * else:
10548  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
10549  * return self.convert_item_to_object(itemp)
10550  *
10551  */
10552  __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
10553  /*else*/ {
10554  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
10555  __pyx_v_itemp = __pyx_t_6;
10556 
10557  /* "View.MemoryView":416
10558  * else:
10559  * itemp = self.get_item_pointer(indices)
10560  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
10561  *
10562  * def __setitem__(memoryview self, object index, object value):
10563  */
10564  __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
10565  __Pyx_XDECREF(__pyx_r);
10566  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
10567  __Pyx_GOTREF(__pyx_t_3);
10568  __pyx_r = __pyx_t_3;
10569  __pyx_t_3 = 0;
10570  goto __pyx_L0;
10571  }
10572 
10573  /* "View.MemoryView":405
10574  *
10575  *
10576  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10577  * if index is Ellipsis:
10578  * return self
10579  */
10580 
10581  /* function exit code */
10582  __pyx_L1_error:;
10583  __Pyx_XDECREF(__pyx_t_3);
10584  __Pyx_XDECREF(__pyx_t_4);
10585  __Pyx_XDECREF(__pyx_t_5);
10586  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10587  __pyx_r = NULL;
10588  __pyx_L0:;
10589  __Pyx_XDECREF(__pyx_v_have_slices);
10590  __Pyx_XDECREF(__pyx_v_indices);
10591  __Pyx_XGIVEREF(__pyx_r);
10592  __Pyx_TraceReturn(__pyx_r, 0);
10593  __Pyx_RefNannyFinishContext();
10594  return __pyx_r;
10595 }
10596 
10597 /* "View.MemoryView":418
10598  * return self.convert_item_to_object(itemp)
10599  *
10600  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10601  * if self.view.readonly:
10602  * raise TypeError("Cannot assign to read-only memoryview")
10603  */
10604 
10605 /* Python wrapper */
10606 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
10607 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10608  int __pyx_r;
10609  __Pyx_RefNannyDeclarations
10610  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10611  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10612 
10613  /* function exit code */
10614  __Pyx_RefNannyFinishContext();
10615  return __pyx_r;
10616 }
10617 
10618 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10619  PyObject *__pyx_v_have_slices = NULL;
10620  PyObject *__pyx_v_obj = NULL;
10621  int __pyx_r;
10622  __Pyx_TraceDeclarations
10623  __Pyx_RefNannyDeclarations
10624  int __pyx_t_1;
10625  PyObject *__pyx_t_2 = NULL;
10626  PyObject *__pyx_t_3 = NULL;
10627  PyObject *__pyx_t_4 = NULL;
10628  int __pyx_lineno = 0;
10629  const char *__pyx_filename = NULL;
10630  int __pyx_clineno = 0;
10631  __Pyx_RefNannySetupContext("__setitem__", 0);
10632  __Pyx_TraceCall("__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
10633  __Pyx_INCREF(__pyx_v_index);
10634 
10635  /* "View.MemoryView":419
10636  *
10637  * def __setitem__(memoryview self, object index, object value):
10638  * if self.view.readonly: # <<<<<<<<<<<<<<
10639  * raise TypeError("Cannot assign to read-only memoryview")
10640  *
10641  */
10642  __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
10643  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10644  if (unlikely(__pyx_t_1)) {
10645 
10646  /* "View.MemoryView":420
10647  * def __setitem__(memoryview self, object index, object value):
10648  * if self.view.readonly:
10649  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
10650  *
10651  * have_slices, index = _unellipsify(index, self.view.ndim)
10652  */
10653  __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10654  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10655  __Pyx_GOTREF(__pyx_t_2);
10656  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10657  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10658  __PYX_ERR(1, 420, __pyx_L1_error)
10659 
10660  /* "View.MemoryView":419
10661  *
10662  * def __setitem__(memoryview self, object index, object value):
10663  * if self.view.readonly: # <<<<<<<<<<<<<<
10664  * raise TypeError("Cannot assign to read-only memoryview")
10665  *
10666  */
10667  }
10668 
10669  /* "View.MemoryView":422
10670  * raise TypeError("Cannot assign to read-only memoryview")
10671  *
10672  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10673  *
10674  * if have_slices:
10675  */
10676  __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10677  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
10678  __Pyx_GOTREF(__pyx_t_2);
10679  if (likely(__pyx_t_2 != Py_None)) {
10680  PyObject* sequence = __pyx_t_2;
10681  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10682  if (unlikely(size != 2)) {
10683  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10684  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10685  __PYX_ERR(1, 422, __pyx_L1_error)
10686  }
10687  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10688  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10689  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10690  __Pyx_INCREF(__pyx_t_3);
10691  __Pyx_INCREF(__pyx_t_4);
10692  #else
10693  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
10694  __Pyx_GOTREF(__pyx_t_3);
10695  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
10696  __Pyx_GOTREF(__pyx_t_4);
10697  #endif
10698  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10699  } else {
10700  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
10701  }
10702  __pyx_v_have_slices = __pyx_t_3;
10703  __pyx_t_3 = 0;
10704  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10705  __pyx_t_4 = 0;
10706 
10707  /* "View.MemoryView":424
10708  * have_slices, index = _unellipsify(index, self.view.ndim)
10709  *
10710  * if have_slices: # <<<<<<<<<<<<<<
10711  * obj = self.is_slice(value)
10712  * if obj:
10713  */
10714  __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10715  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10716  if (__pyx_t_1) {
10717 
10718  /* "View.MemoryView":425
10719  *
10720  * if have_slices:
10721  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
10722  * if obj:
10723  * self.setitem_slice_assignment(self[index], obj)
10724  */
10725  __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10726  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10727  __Pyx_GOTREF(__pyx_t_2);
10728  __pyx_v_obj = __pyx_t_2;
10729  __pyx_t_2 = 0;
10730 
10731  /* "View.MemoryView":426
10732  * if have_slices:
10733  * obj = self.is_slice(value)
10734  * if obj: # <<<<<<<<<<<<<<
10735  * self.setitem_slice_assignment(self[index], obj)
10736  * else:
10737  */
10738  __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
10739  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
10740  if (__pyx_t_1) {
10741 
10742  /* "View.MemoryView":427
10743  * obj = self.is_slice(value)
10744  * if obj:
10745  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
10746  * else:
10747  * self.setitem_slice_assign_scalar(self[index], value)
10748  */
10749  __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10750  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10751  __Pyx_GOTREF(__pyx_t_2);
10752  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10753  __Pyx_GOTREF(__pyx_t_4);
10754  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10755  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10756 
10757  /* "View.MemoryView":426
10758  * if have_slices:
10759  * obj = self.is_slice(value)
10760  * if obj: # <<<<<<<<<<<<<<
10761  * self.setitem_slice_assignment(self[index], obj)
10762  * else:
10763  */
10764  goto __pyx_L5;
10765  }
10766 
10767  /* "View.MemoryView":429
10768  * self.setitem_slice_assignment(self[index], obj)
10769  * else:
10770  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
10771  * else:
10772  * self.setitem_indexed(index, value)
10773  */
10774  __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10775  /*else*/ {
10776  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
10777  __Pyx_GOTREF(__pyx_t_4);
10778  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
10779  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10780  __Pyx_GOTREF(__pyx_t_2);
10781  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10782  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10783  }
10784  __pyx_L5:;
10785 
10786  /* "View.MemoryView":424
10787  * have_slices, index = _unellipsify(index, self.view.ndim)
10788  *
10789  * if have_slices: # <<<<<<<<<<<<<<
10790  * obj = self.is_slice(value)
10791  * if obj:
10792  */
10793  goto __pyx_L4;
10794  }
10795 
10796  /* "View.MemoryView":431
10797  * self.setitem_slice_assign_scalar(self[index], value)
10798  * else:
10799  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
10800  *
10801  * cdef is_slice(self, obj):
10802  */
10803  __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
10804  /*else*/ {
10805  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
10806  __Pyx_GOTREF(__pyx_t_2);
10807  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10808  }
10809  __pyx_L4:;
10810 
10811  /* "View.MemoryView":418
10812  * return self.convert_item_to_object(itemp)
10813  *
10814  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10815  * if self.view.readonly:
10816  * raise TypeError("Cannot assign to read-only memoryview")
10817  */
10818 
10819  /* function exit code */
10820  __pyx_r = 0;
10821  goto __pyx_L0;
10822  __pyx_L1_error:;
10823  __Pyx_XDECREF(__pyx_t_2);
10824  __Pyx_XDECREF(__pyx_t_3);
10825  __Pyx_XDECREF(__pyx_t_4);
10826  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10827  __pyx_r = -1;
10828  __pyx_L0:;
10829  __Pyx_XDECREF(__pyx_v_have_slices);
10830  __Pyx_XDECREF(__pyx_v_obj);
10831  __Pyx_XDECREF(__pyx_v_index);
10832  __Pyx_TraceReturn(Py_None, 0);
10833  __Pyx_RefNannyFinishContext();
10834  return __pyx_r;
10835 }
10836 
10837 /* "View.MemoryView":433
10838  * self.setitem_indexed(index, value)
10839  *
10840  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10841  * if not isinstance(obj, memoryview):
10842  * try:
10843  */
10844 
10845 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10846  PyObject *__pyx_r = NULL;
10847  __Pyx_TraceDeclarations
10848  __Pyx_RefNannyDeclarations
10849  int __pyx_t_1;
10850  int __pyx_t_2;
10851  PyObject *__pyx_t_3 = NULL;
10852  PyObject *__pyx_t_4 = NULL;
10853  PyObject *__pyx_t_5 = NULL;
10854  PyObject *__pyx_t_6 = NULL;
10855  PyObject *__pyx_t_7 = NULL;
10856  PyObject *__pyx_t_8 = NULL;
10857  int __pyx_t_9;
10858  int __pyx_lineno = 0;
10859  const char *__pyx_filename = NULL;
10860  int __pyx_clineno = 0;
10861  __Pyx_RefNannySetupContext("is_slice", 0);
10862  __Pyx_TraceCall("is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
10863  __Pyx_INCREF(__pyx_v_obj);
10864 
10865  /* "View.MemoryView":434
10866  *
10867  * cdef is_slice(self, obj):
10868  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10869  * try:
10870  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10871  */
10872  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
10873  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10874  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10875  if (__pyx_t_2) {
10876 
10877  /* "View.MemoryView":435
10878  * cdef is_slice(self, obj):
10879  * if not isinstance(obj, memoryview):
10880  * try: # <<<<<<<<<<<<<<
10881  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10882  * self.dtype_is_object)
10883  */
10884  __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
10885  {
10886  __Pyx_PyThreadState_declare
10887  __Pyx_PyThreadState_assign
10888  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10889  __Pyx_XGOTREF(__pyx_t_3);
10890  __Pyx_XGOTREF(__pyx_t_4);
10891  __Pyx_XGOTREF(__pyx_t_5);
10892  /*try:*/ {
10893 
10894  /* "View.MemoryView":436
10895  * if not isinstance(obj, memoryview):
10896  * try:
10897  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10898  * self.dtype_is_object)
10899  * except TypeError:
10900  */
10901  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10902  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
10903  __Pyx_GOTREF(__pyx_t_6);
10904 
10905  /* "View.MemoryView":437
10906  * try:
10907  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10908  * self.dtype_is_object) # <<<<<<<<<<<<<<
10909  * except TypeError:
10910  * return None
10911  */
10912  __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
10913  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
10914  __Pyx_GOTREF(__pyx_t_7);
10915 
10916  /* "View.MemoryView":436
10917  * if not isinstance(obj, memoryview):
10918  * try:
10919  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10920  * self.dtype_is_object)
10921  * except TypeError:
10922  */
10923  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10924  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
10925  __Pyx_GOTREF(__pyx_t_8);
10926  __Pyx_INCREF(__pyx_v_obj);
10927  __Pyx_GIVEREF(__pyx_v_obj);
10928  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10929  __Pyx_GIVEREF(__pyx_t_6);
10930  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10931  __Pyx_GIVEREF(__pyx_t_7);
10932  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10933  __pyx_t_6 = 0;
10934  __pyx_t_7 = 0;
10935  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
10936  __Pyx_GOTREF(__pyx_t_7);
10937  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10938  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10939  __pyx_t_7 = 0;
10940 
10941  /* "View.MemoryView":435
10942  * cdef is_slice(self, obj):
10943  * if not isinstance(obj, memoryview):
10944  * try: # <<<<<<<<<<<<<<
10945  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10946  * self.dtype_is_object)
10947  */
10948  }
10949  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10950  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10951  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10952  goto __pyx_L9_try_end;
10953  __pyx_L4_error:;
10954  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10955  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10956  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10957 
10958  /* "View.MemoryView":438
10959  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10960  * self.dtype_is_object)
10961  * except TypeError: # <<<<<<<<<<<<<<
10962  * return None
10963  *
10964  */
10965  __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
10966  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10967  if (__pyx_t_9) {
10968  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10969  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
10970  __Pyx_GOTREF(__pyx_t_7);
10971  __Pyx_GOTREF(__pyx_t_8);
10972  __Pyx_GOTREF(__pyx_t_6);
10973 
10974  /* "View.MemoryView":439
10975  * self.dtype_is_object)
10976  * except TypeError:
10977  * return None # <<<<<<<<<<<<<<
10978  *
10979  * return obj
10980  */
10981  __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
10982  __Pyx_XDECREF(__pyx_r);
10983  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10984  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10985  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10986  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10987  goto __pyx_L7_except_return;
10988  }
10989  goto __pyx_L6_except_error;
10990  __pyx_L6_except_error:;
10991 
10992  /* "View.MemoryView":435
10993  * cdef is_slice(self, obj):
10994  * if not isinstance(obj, memoryview):
10995  * try: # <<<<<<<<<<<<<<
10996  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10997  * self.dtype_is_object)
10998  */
10999  __Pyx_XGIVEREF(__pyx_t_3);
11000  __Pyx_XGIVEREF(__pyx_t_4);
11001  __Pyx_XGIVEREF(__pyx_t_5);
11002  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11003  goto __pyx_L1_error;
11004  __pyx_L7_except_return:;
11005  __Pyx_XGIVEREF(__pyx_t_3);
11006  __Pyx_XGIVEREF(__pyx_t_4);
11007  __Pyx_XGIVEREF(__pyx_t_5);
11008  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11009  goto __pyx_L0;
11010  __pyx_L9_try_end:;
11011  }
11012 
11013  /* "View.MemoryView":434
11014  *
11015  * cdef is_slice(self, obj):
11016  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11017  * try:
11018  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11019  */
11020  }
11021 
11022  /* "View.MemoryView":441
11023  * return None
11024  *
11025  * return obj # <<<<<<<<<<<<<<
11026  *
11027  * cdef setitem_slice_assignment(self, dst, src):
11028  */
11029  __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
11030  __Pyx_XDECREF(__pyx_r);
11031  __Pyx_INCREF(__pyx_v_obj);
11032  __pyx_r = __pyx_v_obj;
11033  goto __pyx_L0;
11034 
11035  /* "View.MemoryView":433
11036  * self.setitem_indexed(index, value)
11037  *
11038  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11039  * if not isinstance(obj, memoryview):
11040  * try:
11041  */
11042 
11043  /* function exit code */
11044  __pyx_L1_error:;
11045  __Pyx_XDECREF(__pyx_t_6);
11046  __Pyx_XDECREF(__pyx_t_7);
11047  __Pyx_XDECREF(__pyx_t_8);
11048  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11049  __pyx_r = 0;
11050  __pyx_L0:;
11051  __Pyx_XDECREF(__pyx_v_obj);
11052  __Pyx_XGIVEREF(__pyx_r);
11053  __Pyx_TraceReturn(__pyx_r, 0);
11054  __Pyx_RefNannyFinishContext();
11055  return __pyx_r;
11056 }
11057 
11058 /* "View.MemoryView":443
11059  * return obj
11060  *
11061  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11062  * cdef __Pyx_memviewslice dst_slice
11063  * cdef __Pyx_memviewslice src_slice
11064  */
11065 
11066 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11067  __Pyx_memviewslice __pyx_v_dst_slice;
11068  __Pyx_memviewslice __pyx_v_src_slice;
11069  PyObject *__pyx_r = NULL;
11070  __Pyx_TraceDeclarations
11071  __Pyx_RefNannyDeclarations
11072  __Pyx_memviewslice *__pyx_t_1;
11073  __Pyx_memviewslice *__pyx_t_2;
11074  PyObject *__pyx_t_3 = NULL;
11075  int __pyx_t_4;
11076  int __pyx_t_5;
11077  int __pyx_t_6;
11078  int __pyx_lineno = 0;
11079  const char *__pyx_filename = NULL;
11080  int __pyx_clineno = 0;
11081  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11082  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
11083 
11084  /* "View.MemoryView":447
11085  * cdef __Pyx_memviewslice src_slice
11086  *
11087  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11088  * get_slice_from_memview(dst, &dst_slice)[0],
11089  * src.ndim, dst.ndim, self.dtype_is_object)
11090  */
11091  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11092  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
11093  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
11094 
11095  /* "View.MemoryView":448
11096  *
11097  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11098  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11099  * src.ndim, dst.ndim, self.dtype_is_object)
11100  *
11101  */
11102  __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
11103  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
11104  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
11105 
11106  /* "View.MemoryView":449
11107  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11108  * get_slice_from_memview(dst, &dst_slice)[0],
11109  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11110  *
11111  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11112  */
11113  __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
11114  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11115  __Pyx_GOTREF(__pyx_t_3);
11116  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11117  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11118  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11119  __Pyx_GOTREF(__pyx_t_3);
11120  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11121  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11122 
11123  /* "View.MemoryView":447
11124  * cdef __Pyx_memviewslice src_slice
11125  *
11126  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11127  * get_slice_from_memview(dst, &dst_slice)[0],
11128  * src.ndim, dst.ndim, self.dtype_is_object)
11129  */
11130  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11131  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
11132 
11133  /* "View.MemoryView":443
11134  * return obj
11135  *
11136  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11137  * cdef __Pyx_memviewslice dst_slice
11138  * cdef __Pyx_memviewslice src_slice
11139  */
11140 
11141  /* function exit code */
11142  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11143  goto __pyx_L0;
11144  __pyx_L1_error:;
11145  __Pyx_XDECREF(__pyx_t_3);
11146  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11147  __pyx_r = 0;
11148  __pyx_L0:;
11149  __Pyx_XGIVEREF(__pyx_r);
11150  __Pyx_TraceReturn(__pyx_r, 0);
11151  __Pyx_RefNannyFinishContext();
11152  return __pyx_r;
11153 }
11154 
11155 /* "View.MemoryView":451
11156  * src.ndim, dst.ndim, self.dtype_is_object)
11157  *
11158  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11159  * cdef int array[128]
11160  * cdef void *tmp = NULL
11161  */
11162 
11163 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11164  int __pyx_v_array[0x80];
11165  void *__pyx_v_tmp;
11166  void *__pyx_v_item;
11167  __Pyx_memviewslice *__pyx_v_dst_slice;
11168  __Pyx_memviewslice __pyx_v_tmp_slice;
11169  PyObject *__pyx_r = NULL;
11170  __Pyx_TraceDeclarations
11171  __Pyx_RefNannyDeclarations
11172  __Pyx_memviewslice *__pyx_t_1;
11173  int __pyx_t_2;
11174  PyObject *__pyx_t_3 = NULL;
11175  int __pyx_t_4;
11176  int __pyx_t_5;
11177  char const *__pyx_t_6;
11178  PyObject *__pyx_t_7 = NULL;
11179  PyObject *__pyx_t_8 = NULL;
11180  PyObject *__pyx_t_9 = NULL;
11181  PyObject *__pyx_t_10 = NULL;
11182  PyObject *__pyx_t_11 = NULL;
11183  PyObject *__pyx_t_12 = NULL;
11184  int __pyx_lineno = 0;
11185  const char *__pyx_filename = NULL;
11186  int __pyx_clineno = 0;
11187  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11188  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
11189 
11190  /* "View.MemoryView":453
11191  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11192  * cdef int array[128]
11193  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11194  * cdef void *item
11195  *
11196  */
11197  __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
11198  __pyx_v_tmp = NULL;
11199 
11200  /* "View.MemoryView":458
11201  * cdef __Pyx_memviewslice *dst_slice
11202  * cdef __Pyx_memviewslice tmp_slice
11203  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11204  *
11205  * if <size_t>self.view.itemsize > sizeof(array):
11206  */
11207  __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
11208  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
11209  __pyx_v_dst_slice = __pyx_t_1;
11210 
11211  /* "View.MemoryView":460
11212  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11213  *
11214  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11215  * tmp = PyMem_Malloc(self.view.itemsize)
11216  * if tmp == NULL:
11217  */
11218  __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
11219  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11220  if (__pyx_t_2) {
11221 
11222  /* "View.MemoryView":461
11223  *
11224  * if <size_t>self.view.itemsize > sizeof(array):
11225  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11226  * if tmp == NULL:
11227  * raise MemoryError
11228  */
11229  __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
11230  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11231 
11232  /* "View.MemoryView":462
11233  * if <size_t>self.view.itemsize > sizeof(array):
11234  * tmp = PyMem_Malloc(self.view.itemsize)
11235  * if tmp == NULL: # <<<<<<<<<<<<<<
11236  * raise MemoryError
11237  * item = tmp
11238  */
11239  __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
11240  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11241  if (unlikely(__pyx_t_2)) {
11242 
11243  /* "View.MemoryView":463
11244  * tmp = PyMem_Malloc(self.view.itemsize)
11245  * if tmp == NULL:
11246  * raise MemoryError # <<<<<<<<<<<<<<
11247  * item = tmp
11248  * else:
11249  */
11250  __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
11251  PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
11252 
11253  /* "View.MemoryView":462
11254  * if <size_t>self.view.itemsize > sizeof(array):
11255  * tmp = PyMem_Malloc(self.view.itemsize)
11256  * if tmp == NULL: # <<<<<<<<<<<<<<
11257  * raise MemoryError
11258  * item = tmp
11259  */
11260  }
11261 
11262  /* "View.MemoryView":464
11263  * if tmp == NULL:
11264  * raise MemoryError
11265  * item = tmp # <<<<<<<<<<<<<<
11266  * else:
11267  * item = <void *> array
11268  */
11269  __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
11270  __pyx_v_item = __pyx_v_tmp;
11271 
11272  /* "View.MemoryView":460
11273  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11274  *
11275  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11276  * tmp = PyMem_Malloc(self.view.itemsize)
11277  * if tmp == NULL:
11278  */
11279  goto __pyx_L3;
11280  }
11281 
11282  /* "View.MemoryView":466
11283  * item = tmp
11284  * else:
11285  * item = <void *> array # <<<<<<<<<<<<<<
11286  *
11287  * try:
11288  */
11289  __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
11290  /*else*/ {
11291  __pyx_v_item = ((void *)__pyx_v_array);
11292  }
11293  __pyx_L3:;
11294 
11295  /* "View.MemoryView":468
11296  * item = <void *> array
11297  *
11298  * try: # <<<<<<<<<<<<<<
11299  * if self.dtype_is_object:
11300  * (<PyObject **> item)[0] = <PyObject *> value
11301  */
11302  __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
11303  /*try:*/ {
11304 
11305  /* "View.MemoryView":469
11306  *
11307  * try:
11308  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11309  * (<PyObject **> item)[0] = <PyObject *> value
11310  * else:
11311  */
11312  __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
11313  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11314  if (__pyx_t_2) {
11315 
11316  /* "View.MemoryView":470
11317  * try:
11318  * if self.dtype_is_object:
11319  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11320  * else:
11321  * self.assign_item_from_object(<char *> item, value)
11322  */
11323  __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
11324  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11325 
11326  /* "View.MemoryView":469
11327  *
11328  * try:
11329  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11330  * (<PyObject **> item)[0] = <PyObject *> value
11331  * else:
11332  */
11333  goto __pyx_L8;
11334  }
11335 
11336  /* "View.MemoryView":472
11337  * (<PyObject **> item)[0] = <PyObject *> value
11338  * else:
11339  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11340  *
11341  *
11342  */
11343  __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
11344  /*else*/ {
11345  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
11346  __Pyx_GOTREF(__pyx_t_3);
11347  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11348  }
11349  __pyx_L8:;
11350 
11351  /* "View.MemoryView":476
11352  *
11353  *
11354  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11355  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11356  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11357  */
11358  __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
11359  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11360  if (__pyx_t_2) {
11361 
11362  /* "View.MemoryView":477
11363  *
11364  * if self.view.suboffsets != NULL:
11365  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11366  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11367  * item, self.dtype_is_object)
11368  */
11369  __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
11370  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
11371  __Pyx_GOTREF(__pyx_t_3);
11372  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11373 
11374  /* "View.MemoryView":476
11375  *
11376  *
11377  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11378  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11379  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11380  */
11381  }
11382 
11383  /* "View.MemoryView":478
11384  * if self.view.suboffsets != NULL:
11385  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11386  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11387  * item, self.dtype_is_object)
11388  * finally:
11389  */
11390  __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
11391  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11392  }
11393 
11394  /* "View.MemoryView":481
11395  * item, self.dtype_is_object)
11396  * finally:
11397  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11398  *
11399  * cdef setitem_indexed(self, index, value):
11400  */
11401  __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
11402  /*finally:*/ {
11403  /*normal exit:*/{
11404  PyMem_Free(__pyx_v_tmp);
11405  goto __pyx_L7;
11406  }
11407  __pyx_L6_error:;
11408  /*exception exit:*/{
11409  __Pyx_PyThreadState_declare
11410  __Pyx_PyThreadState_assign
11411  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11412  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11413  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11414  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11415  __Pyx_XGOTREF(__pyx_t_7);
11416  __Pyx_XGOTREF(__pyx_t_8);
11417  __Pyx_XGOTREF(__pyx_t_9);
11418  __Pyx_XGOTREF(__pyx_t_10);
11419  __Pyx_XGOTREF(__pyx_t_11);
11420  __Pyx_XGOTREF(__pyx_t_12);
11421  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11422  {
11423  PyMem_Free(__pyx_v_tmp);
11424  }
11425  if (PY_MAJOR_VERSION >= 3) {
11426  __Pyx_XGIVEREF(__pyx_t_10);
11427  __Pyx_XGIVEREF(__pyx_t_11);
11428  __Pyx_XGIVEREF(__pyx_t_12);
11429  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11430  }
11431  __Pyx_XGIVEREF(__pyx_t_7);
11432  __Pyx_XGIVEREF(__pyx_t_8);
11433  __Pyx_XGIVEREF(__pyx_t_9);
11434  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11435  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11436  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11437  goto __pyx_L1_error;
11438  }
11439  __pyx_L7:;
11440  }
11441 
11442  /* "View.MemoryView":451
11443  * src.ndim, dst.ndim, self.dtype_is_object)
11444  *
11445  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11446  * cdef int array[128]
11447  * cdef void *tmp = NULL
11448  */
11449 
11450  /* function exit code */
11451  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11452  goto __pyx_L0;
11453  __pyx_L1_error:;
11454  __Pyx_XDECREF(__pyx_t_3);
11455  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11456  __pyx_r = 0;
11457  __pyx_L0:;
11458  __Pyx_XGIVEREF(__pyx_r);
11459  __Pyx_TraceReturn(__pyx_r, 0);
11460  __Pyx_RefNannyFinishContext();
11461  return __pyx_r;
11462 }
11463 
11464 /* "View.MemoryView":483
11465  * PyMem_Free(tmp)
11466  *
11467  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11468  * cdef char *itemp = self.get_item_pointer(index)
11469  * self.assign_item_from_object(itemp, value)
11470  */
11471 
11472 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11473  char *__pyx_v_itemp;
11474  PyObject *__pyx_r = NULL;
11475  __Pyx_TraceDeclarations
11476  __Pyx_RefNannyDeclarations
11477  char *__pyx_t_1;
11478  PyObject *__pyx_t_2 = NULL;
11479  int __pyx_lineno = 0;
11480  const char *__pyx_filename = NULL;
11481  int __pyx_clineno = 0;
11482  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11483  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
11484 
11485  /* "View.MemoryView":484
11486  *
11487  * cdef setitem_indexed(self, index, value):
11488  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11489  * self.assign_item_from_object(itemp, value)
11490  *
11491  */
11492  __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
11493  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
11494  __pyx_v_itemp = __pyx_t_1;
11495 
11496  /* "View.MemoryView":485
11497  * cdef setitem_indexed(self, index, value):
11498  * cdef char *itemp = self.get_item_pointer(index)
11499  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11500  *
11501  * cdef convert_item_to_object(self, char *itemp):
11502  */
11503  __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
11504  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
11505  __Pyx_GOTREF(__pyx_t_2);
11506  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11507 
11508  /* "View.MemoryView":483
11509  * PyMem_Free(tmp)
11510  *
11511  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11512  * cdef char *itemp = self.get_item_pointer(index)
11513  * self.assign_item_from_object(itemp, value)
11514  */
11515 
11516  /* function exit code */
11517  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11518  goto __pyx_L0;
11519  __pyx_L1_error:;
11520  __Pyx_XDECREF(__pyx_t_2);
11521  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11522  __pyx_r = 0;
11523  __pyx_L0:;
11524  __Pyx_XGIVEREF(__pyx_r);
11525  __Pyx_TraceReturn(__pyx_r, 0);
11526  __Pyx_RefNannyFinishContext();
11527  return __pyx_r;
11528 }
11529 
11530 /* "View.MemoryView":487
11531  * self.assign_item_from_object(itemp, value)
11532  *
11533  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11534  * """Only used if instantiated manually by the user, or if Cython doesn't
11535  * know how to convert the type"""
11536  */
11537 
11538 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11539  PyObject *__pyx_v_struct = NULL;
11540  PyObject *__pyx_v_bytesitem = 0;
11541  PyObject *__pyx_v_result = NULL;
11542  PyObject *__pyx_r = NULL;
11543  __Pyx_TraceDeclarations
11544  __Pyx_RefNannyDeclarations
11545  PyObject *__pyx_t_1 = NULL;
11546  PyObject *__pyx_t_2 = NULL;
11547  PyObject *__pyx_t_3 = NULL;
11548  PyObject *__pyx_t_4 = NULL;
11549  PyObject *__pyx_t_5 = NULL;
11550  PyObject *__pyx_t_6 = NULL;
11551  PyObject *__pyx_t_7 = NULL;
11552  int __pyx_t_8;
11553  PyObject *__pyx_t_9 = NULL;
11554  size_t __pyx_t_10;
11555  int __pyx_t_11;
11556  int __pyx_lineno = 0;
11557  const char *__pyx_filename = NULL;
11558  int __pyx_clineno = 0;
11559  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11560  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
11561 
11562  /* "View.MemoryView":490
11563  * """Only used if instantiated manually by the user, or if Cython doesn't
11564  * know how to convert the type"""
11565  * import struct # <<<<<<<<<<<<<<
11566  * cdef bytes bytesitem
11567  *
11568  */
11569  __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
11570  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
11571  __Pyx_GOTREF(__pyx_t_1);
11572  __pyx_v_struct = __pyx_t_1;
11573  __pyx_t_1 = 0;
11574 
11575  /* "View.MemoryView":493
11576  * cdef bytes bytesitem
11577  *
11578  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11579  * try:
11580  * result = struct.unpack(self.view.format, bytesitem)
11581  */
11582  __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
11583  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
11584  __Pyx_GOTREF(__pyx_t_1);
11585  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11586  __pyx_t_1 = 0;
11587 
11588  /* "View.MemoryView":494
11589  *
11590  * bytesitem = itemp[:self.view.itemsize]
11591  * try: # <<<<<<<<<<<<<<
11592  * result = struct.unpack(self.view.format, bytesitem)
11593  * except struct.error:
11594  */
11595  __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
11596  {
11597  __Pyx_PyThreadState_declare
11598  __Pyx_PyThreadState_assign
11599  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11600  __Pyx_XGOTREF(__pyx_t_2);
11601  __Pyx_XGOTREF(__pyx_t_3);
11602  __Pyx_XGOTREF(__pyx_t_4);
11603  /*try:*/ {
11604 
11605  /* "View.MemoryView":495
11606  * bytesitem = itemp[:self.view.itemsize]
11607  * try:
11608  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
11609  * except struct.error:
11610  * raise ValueError("Unable to convert item to object")
11611  */
11612  __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
11613  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
11614  __Pyx_GOTREF(__pyx_t_5);
11615  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
11616  __Pyx_GOTREF(__pyx_t_6);
11617  __pyx_t_7 = NULL;
11618  __pyx_t_8 = 0;
11619  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11620  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11621  if (likely(__pyx_t_7)) {
11622  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11623  __Pyx_INCREF(__pyx_t_7);
11624  __Pyx_INCREF(function);
11625  __Pyx_DECREF_SET(__pyx_t_5, function);
11626  __pyx_t_8 = 1;
11627  }
11628  }
11629  #if CYTHON_FAST_PYCALL
11630  if (PyFunction_Check(__pyx_t_5)) {
11631  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11632  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11633  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11634  __Pyx_GOTREF(__pyx_t_1);
11635  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11636  } else
11637  #endif
11638  #if CYTHON_FAST_PYCCALL
11639  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11640  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11641  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11642  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11643  __Pyx_GOTREF(__pyx_t_1);
11644  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11645  } else
11646  #endif
11647  {
11648  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
11649  __Pyx_GOTREF(__pyx_t_9);
11650  if (__pyx_t_7) {
11651  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11652  }
11653  __Pyx_GIVEREF(__pyx_t_6);
11654  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11655  __Pyx_INCREF(__pyx_v_bytesitem);
11656  __Pyx_GIVEREF(__pyx_v_bytesitem);
11657  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11658  __pyx_t_6 = 0;
11659  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11660  __Pyx_GOTREF(__pyx_t_1);
11661  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11662  }
11663  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11664  __pyx_v_result = __pyx_t_1;
11665  __pyx_t_1 = 0;
11666 
11667  /* "View.MemoryView":494
11668  *
11669  * bytesitem = itemp[:self.view.itemsize]
11670  * try: # <<<<<<<<<<<<<<
11671  * result = struct.unpack(self.view.format, bytesitem)
11672  * except struct.error:
11673  */
11674  }
11675 
11676  /* "View.MemoryView":499
11677  * raise ValueError("Unable to convert item to object")
11678  * else:
11679  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11680  * return result[0]
11681  * return result
11682  */
11683  __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11684  /*else:*/ {
11685  __pyx_t_10 = strlen(__pyx_v_self->view.format);
11686  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11687  if (__pyx_t_11) {
11688 
11689  /* "View.MemoryView":500
11690  * else:
11691  * if len(self.view.format) == 1:
11692  * return result[0] # <<<<<<<<<<<<<<
11693  * return result
11694  *
11695  */
11696  __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
11697  __Pyx_XDECREF(__pyx_r);
11698  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
11699  __Pyx_GOTREF(__pyx_t_1);
11700  __pyx_r = __pyx_t_1;
11701  __pyx_t_1 = 0;
11702  goto __pyx_L6_except_return;
11703 
11704  /* "View.MemoryView":499
11705  * raise ValueError("Unable to convert item to object")
11706  * else:
11707  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11708  * return result[0]
11709  * return result
11710  */
11711  }
11712 
11713  /* "View.MemoryView":501
11714  * if len(self.view.format) == 1:
11715  * return result[0]
11716  * return result # <<<<<<<<<<<<<<
11717  *
11718  * cdef assign_item_from_object(self, char *itemp, object value):
11719  */
11720  __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
11721  __Pyx_XDECREF(__pyx_r);
11722  __Pyx_INCREF(__pyx_v_result);
11723  __pyx_r = __pyx_v_result;
11724  goto __pyx_L6_except_return;
11725  }
11726  __pyx_L3_error:;
11727  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11728  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11729  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11730  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11731  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11732 
11733  /* "View.MemoryView":496
11734  * try:
11735  * result = struct.unpack(self.view.format, bytesitem)
11736  * except struct.error: # <<<<<<<<<<<<<<
11737  * raise ValueError("Unable to convert item to object")
11738  * else:
11739  */
11740  __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
11741  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11742  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
11743  __Pyx_GOTREF(__pyx_t_6);
11744  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11745  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11746  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11747  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11748  if (__pyx_t_8) {
11749  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11750  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
11751  __Pyx_GOTREF(__pyx_t_9);
11752  __Pyx_GOTREF(__pyx_t_5);
11753  __Pyx_GOTREF(__pyx_t_1);
11754 
11755  /* "View.MemoryView":497
11756  * result = struct.unpack(self.view.format, bytesitem)
11757  * except struct.error:
11758  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
11759  * else:
11760  * if len(self.view.format) == 1:
11761  */
11762  __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11763  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
11764  __Pyx_GOTREF(__pyx_t_6);
11765  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11766  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11767  __PYX_ERR(1, 497, __pyx_L5_except_error)
11768  }
11769  goto __pyx_L5_except_error;
11770  __pyx_L5_except_error:;
11771 
11772  /* "View.MemoryView":494
11773  *
11774  * bytesitem = itemp[:self.view.itemsize]
11775  * try: # <<<<<<<<<<<<<<
11776  * result = struct.unpack(self.view.format, bytesitem)
11777  * except struct.error:
11778  */
11779  __Pyx_XGIVEREF(__pyx_t_2);
11780  __Pyx_XGIVEREF(__pyx_t_3);
11781  __Pyx_XGIVEREF(__pyx_t_4);
11782  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11783  goto __pyx_L1_error;
11784  __pyx_L6_except_return:;
11785  __Pyx_XGIVEREF(__pyx_t_2);
11786  __Pyx_XGIVEREF(__pyx_t_3);
11787  __Pyx_XGIVEREF(__pyx_t_4);
11788  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11789  goto __pyx_L0;
11790  }
11791 
11792  /* "View.MemoryView":487
11793  * self.assign_item_from_object(itemp, value)
11794  *
11795  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11796  * """Only used if instantiated manually by the user, or if Cython doesn't
11797  * know how to convert the type"""
11798  */
11799 
11800  /* function exit code */
11801  __pyx_L1_error:;
11802  __Pyx_XDECREF(__pyx_t_1);
11803  __Pyx_XDECREF(__pyx_t_5);
11804  __Pyx_XDECREF(__pyx_t_6);
11805  __Pyx_XDECREF(__pyx_t_7);
11806  __Pyx_XDECREF(__pyx_t_9);
11807  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11808  __pyx_r = 0;
11809  __pyx_L0:;
11810  __Pyx_XDECREF(__pyx_v_struct);
11811  __Pyx_XDECREF(__pyx_v_bytesitem);
11812  __Pyx_XDECREF(__pyx_v_result);
11813  __Pyx_XGIVEREF(__pyx_r);
11814  __Pyx_TraceReturn(__pyx_r, 0);
11815  __Pyx_RefNannyFinishContext();
11816  return __pyx_r;
11817 }
11818 
11819 /* "View.MemoryView":503
11820  * return result
11821  *
11822  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11823  * """Only used if instantiated manually by the user, or if Cython doesn't
11824  * know how to convert the type"""
11825  */
11826 
11827 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11828  PyObject *__pyx_v_struct = NULL;
11829  char __pyx_v_c;
11830  PyObject *__pyx_v_bytesvalue = 0;
11831  Py_ssize_t __pyx_v_i;
11832  PyObject *__pyx_r = NULL;
11833  __Pyx_TraceDeclarations
11834  __Pyx_RefNannyDeclarations
11835  PyObject *__pyx_t_1 = NULL;
11836  int __pyx_t_2;
11837  int __pyx_t_3;
11838  PyObject *__pyx_t_4 = NULL;
11839  PyObject *__pyx_t_5 = NULL;
11840  PyObject *__pyx_t_6 = NULL;
11841  int __pyx_t_7;
11842  PyObject *__pyx_t_8 = NULL;
11843  Py_ssize_t __pyx_t_9;
11844  PyObject *__pyx_t_10 = NULL;
11845  char *__pyx_t_11;
11846  char *__pyx_t_12;
11847  char *__pyx_t_13;
11848  char *__pyx_t_14;
11849  int __pyx_lineno = 0;
11850  const char *__pyx_filename = NULL;
11851  int __pyx_clineno = 0;
11852  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
11853  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
11854 
11855  /* "View.MemoryView":506
11856  * """Only used if instantiated manually by the user, or if Cython doesn't
11857  * know how to convert the type"""
11858  * import struct # <<<<<<<<<<<<<<
11859  * cdef char c
11860  * cdef bytes bytesvalue
11861  */
11862  __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
11863  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
11864  __Pyx_GOTREF(__pyx_t_1);
11865  __pyx_v_struct = __pyx_t_1;
11866  __pyx_t_1 = 0;
11867 
11868  /* "View.MemoryView":511
11869  * cdef Py_ssize_t i
11870  *
11871  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11872  * bytesvalue = struct.pack(self.view.format, *value)
11873  * else:
11874  */
11875  __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
11876  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11877  __pyx_t_3 = (__pyx_t_2 != 0);
11878  if (__pyx_t_3) {
11879 
11880  /* "View.MemoryView":512
11881  *
11882  * if isinstance(value, tuple):
11883  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
11884  * else:
11885  * bytesvalue = struct.pack(self.view.format, value)
11886  */
11887  __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11888  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11889  __Pyx_GOTREF(__pyx_t_1);
11890  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11891  __Pyx_GOTREF(__pyx_t_4);
11892  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
11893  __Pyx_GOTREF(__pyx_t_5);
11894  __Pyx_GIVEREF(__pyx_t_4);
11895  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11896  __pyx_t_4 = 0;
11897  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11898  __Pyx_GOTREF(__pyx_t_4);
11899  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11900  __Pyx_GOTREF(__pyx_t_6);
11901  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11902  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11903  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11904  __Pyx_GOTREF(__pyx_t_4);
11905  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11906  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11907  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11908  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11909  __pyx_t_4 = 0;
11910 
11911  /* "View.MemoryView":511
11912  * cdef Py_ssize_t i
11913  *
11914  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11915  * bytesvalue = struct.pack(self.view.format, *value)
11916  * else:
11917  */
11918  goto __pyx_L3;
11919  }
11920 
11921  /* "View.MemoryView":514
11922  * bytesvalue = struct.pack(self.view.format, *value)
11923  * else:
11924  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
11925  *
11926  * for i, c in enumerate(bytesvalue):
11927  */
11928  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11929  /*else*/ {
11930  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
11931  __Pyx_GOTREF(__pyx_t_6);
11932  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
11933  __Pyx_GOTREF(__pyx_t_1);
11934  __pyx_t_5 = NULL;
11935  __pyx_t_7 = 0;
11936  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11937  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11938  if (likely(__pyx_t_5)) {
11939  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11940  __Pyx_INCREF(__pyx_t_5);
11941  __Pyx_INCREF(function);
11942  __Pyx_DECREF_SET(__pyx_t_6, function);
11943  __pyx_t_7 = 1;
11944  }
11945  }
11946  #if CYTHON_FAST_PYCALL
11947  if (PyFunction_Check(__pyx_t_6)) {
11948  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11949  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11950  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11951  __Pyx_GOTREF(__pyx_t_4);
11952  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11953  } else
11954  #endif
11955  #if CYTHON_FAST_PYCCALL
11956  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11957  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11958  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11959  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11960  __Pyx_GOTREF(__pyx_t_4);
11961  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11962  } else
11963  #endif
11964  {
11965  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
11966  __Pyx_GOTREF(__pyx_t_8);
11967  if (__pyx_t_5) {
11968  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11969  }
11970  __Pyx_GIVEREF(__pyx_t_1);
11971  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11972  __Pyx_INCREF(__pyx_v_value);
11973  __Pyx_GIVEREF(__pyx_v_value);
11974  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11975  __pyx_t_1 = 0;
11976  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11977  __Pyx_GOTREF(__pyx_t_4);
11978  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11979  }
11980  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11981  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
11982  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11983  __pyx_t_4 = 0;
11984  }
11985  __pyx_L3:;
11986 
11987  /* "View.MemoryView":516
11988  * bytesvalue = struct.pack(self.view.format, value)
11989  *
11990  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11991  * itemp[i] = c
11992  *
11993  */
11994  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
11995  __pyx_t_9 = 0;
11996  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11997  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
11998  __PYX_ERR(1, 516, __pyx_L1_error)
11999  }
12000  __Pyx_INCREF(__pyx_v_bytesvalue);
12001  __pyx_t_10 = __pyx_v_bytesvalue;
12002  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12003  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12004  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12005  __pyx_t_11 = __pyx_t_14;
12006  __pyx_v_c = (__pyx_t_11[0]);
12007 
12008  /* "View.MemoryView":517
12009  *
12010  * for i, c in enumerate(bytesvalue):
12011  * itemp[i] = c # <<<<<<<<<<<<<<
12012  *
12013  * @cname('getbuffer')
12014  */
12015  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12016  __pyx_v_i = __pyx_t_9;
12017 
12018  /* "View.MemoryView":516
12019  * bytesvalue = struct.pack(self.view.format, value)
12020  *
12021  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12022  * itemp[i] = c
12023  *
12024  */
12025  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
12026  __pyx_t_9 = (__pyx_t_9 + 1);
12027 
12028  /* "View.MemoryView":517
12029  *
12030  * for i, c in enumerate(bytesvalue):
12031  * itemp[i] = c # <<<<<<<<<<<<<<
12032  *
12033  * @cname('getbuffer')
12034  */
12035  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12036  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12037  }
12038  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12039 
12040  /* "View.MemoryView":503
12041  * return result
12042  *
12043  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12044  * """Only used if instantiated manually by the user, or if Cython doesn't
12045  * know how to convert the type"""
12046  */
12047 
12048  /* function exit code */
12049  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12050  goto __pyx_L0;
12051  __pyx_L1_error:;
12052  __Pyx_XDECREF(__pyx_t_1);
12053  __Pyx_XDECREF(__pyx_t_4);
12054  __Pyx_XDECREF(__pyx_t_5);
12055  __Pyx_XDECREF(__pyx_t_6);
12056  __Pyx_XDECREF(__pyx_t_8);
12057  __Pyx_XDECREF(__pyx_t_10);
12058  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059  __pyx_r = 0;
12060  __pyx_L0:;
12061  __Pyx_XDECREF(__pyx_v_struct);
12062  __Pyx_XDECREF(__pyx_v_bytesvalue);
12063  __Pyx_XGIVEREF(__pyx_r);
12064  __Pyx_TraceReturn(__pyx_r, 0);
12065  __Pyx_RefNannyFinishContext();
12066  return __pyx_r;
12067 }
12068 
12069 /* "View.MemoryView":520
12070  *
12071  * @cname('getbuffer')
12072  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12073  * if flags & PyBUF_WRITABLE and self.view.readonly:
12074  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12075  */
12076 
12077 /* Python wrapper */
12078 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12079 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12080  int __pyx_r;
12081  __Pyx_RefNannyDeclarations
12082  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12083  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12084 
12085  /* function exit code */
12086  __Pyx_RefNannyFinishContext();
12087  return __pyx_r;
12088 }
12089 
12090 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12091  int __pyx_r;
12092  __Pyx_TraceDeclarations
12093  __Pyx_RefNannyDeclarations
12094  int __pyx_t_1;
12095  int __pyx_t_2;
12096  PyObject *__pyx_t_3 = NULL;
12097  Py_ssize_t *__pyx_t_4;
12098  char *__pyx_t_5;
12099  void *__pyx_t_6;
12100  int __pyx_t_7;
12101  Py_ssize_t __pyx_t_8;
12102  int __pyx_lineno = 0;
12103  const char *__pyx_filename = NULL;
12104  int __pyx_clineno = 0;
12105  if (__pyx_v_info == NULL) {
12106  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12107  return -1;
12108  }
12109  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12110  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12111  __Pyx_GIVEREF(__pyx_v_info->obj);
12112  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
12113 
12114  /* "View.MemoryView":521
12115  * @cname('getbuffer')
12116  * def __getbuffer__(self, Py_buffer *info, int flags):
12117  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12118  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12119  *
12120  */
12121  __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
12122  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12123  if (__pyx_t_2) {
12124  } else {
12125  __pyx_t_1 = __pyx_t_2;
12126  goto __pyx_L4_bool_binop_done;
12127  }
12128  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12129  __pyx_t_1 = __pyx_t_2;
12130  __pyx_L4_bool_binop_done:;
12131  if (unlikely(__pyx_t_1)) {
12132 
12133  /* "View.MemoryView":522
12134  * def __getbuffer__(self, Py_buffer *info, int flags):
12135  * if flags & PyBUF_WRITABLE and self.view.readonly:
12136  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12137  *
12138  * if flags & PyBUF_ND:
12139  */
12140  __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
12141  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
12142  __Pyx_GOTREF(__pyx_t_3);
12143  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12144  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12145  __PYX_ERR(1, 522, __pyx_L1_error)
12146 
12147  /* "View.MemoryView":521
12148  * @cname('getbuffer')
12149  * def __getbuffer__(self, Py_buffer *info, int flags):
12150  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12151  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12152  *
12153  */
12154  }
12155 
12156  /* "View.MemoryView":524
12157  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12158  *
12159  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12160  * info.shape = self.view.shape
12161  * else:
12162  */
12163  __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
12164  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12165  if (__pyx_t_1) {
12166 
12167  /* "View.MemoryView":525
12168  *
12169  * if flags & PyBUF_ND:
12170  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12171  * else:
12172  * info.shape = NULL
12173  */
12174  __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
12175  __pyx_t_4 = __pyx_v_self->view.shape;
12176  __pyx_v_info->shape = __pyx_t_4;
12177 
12178  /* "View.MemoryView":524
12179  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12180  *
12181  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12182  * info.shape = self.view.shape
12183  * else:
12184  */
12185  goto __pyx_L6;
12186  }
12187 
12188  /* "View.MemoryView":527
12189  * info.shape = self.view.shape
12190  * else:
12191  * info.shape = NULL # <<<<<<<<<<<<<<
12192  *
12193  * if flags & PyBUF_STRIDES:
12194  */
12195  __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
12196  /*else*/ {
12197  __pyx_v_info->shape = NULL;
12198  }
12199  __pyx_L6:;
12200 
12201  /* "View.MemoryView":529
12202  * info.shape = NULL
12203  *
12204  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12205  * info.strides = self.view.strides
12206  * else:
12207  */
12208  __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
12209  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12210  if (__pyx_t_1) {
12211 
12212  /* "View.MemoryView":530
12213  *
12214  * if flags & PyBUF_STRIDES:
12215  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12216  * else:
12217  * info.strides = NULL
12218  */
12219  __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
12220  __pyx_t_4 = __pyx_v_self->view.strides;
12221  __pyx_v_info->strides = __pyx_t_4;
12222 
12223  /* "View.MemoryView":529
12224  * info.shape = NULL
12225  *
12226  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12227  * info.strides = self.view.strides
12228  * else:
12229  */
12230  goto __pyx_L7;
12231  }
12232 
12233  /* "View.MemoryView":532
12234  * info.strides = self.view.strides
12235  * else:
12236  * info.strides = NULL # <<<<<<<<<<<<<<
12237  *
12238  * if flags & PyBUF_INDIRECT:
12239  */
12240  __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
12241  /*else*/ {
12242  __pyx_v_info->strides = NULL;
12243  }
12244  __pyx_L7:;
12245 
12246  /* "View.MemoryView":534
12247  * info.strides = NULL
12248  *
12249  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12250  * info.suboffsets = self.view.suboffsets
12251  * else:
12252  */
12253  __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
12254  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12255  if (__pyx_t_1) {
12256 
12257  /* "View.MemoryView":535
12258  *
12259  * if flags & PyBUF_INDIRECT:
12260  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12261  * else:
12262  * info.suboffsets = NULL
12263  */
12264  __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
12265  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12266  __pyx_v_info->suboffsets = __pyx_t_4;
12267 
12268  /* "View.MemoryView":534
12269  * info.strides = NULL
12270  *
12271  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12272  * info.suboffsets = self.view.suboffsets
12273  * else:
12274  */
12275  goto __pyx_L8;
12276  }
12277 
12278  /* "View.MemoryView":537
12279  * info.suboffsets = self.view.suboffsets
12280  * else:
12281  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12282  *
12283  * if flags & PyBUF_FORMAT:
12284  */
12285  __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
12286  /*else*/ {
12287  __pyx_v_info->suboffsets = NULL;
12288  }
12289  __pyx_L8:;
12290 
12291  /* "View.MemoryView":539
12292  * info.suboffsets = NULL
12293  *
12294  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12295  * info.format = self.view.format
12296  * else:
12297  */
12298  __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
12299  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12300  if (__pyx_t_1) {
12301 
12302  /* "View.MemoryView":540
12303  *
12304  * if flags & PyBUF_FORMAT:
12305  * info.format = self.view.format # <<<<<<<<<<<<<<
12306  * else:
12307  * info.format = NULL
12308  */
12309  __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
12310  __pyx_t_5 = __pyx_v_self->view.format;
12311  __pyx_v_info->format = __pyx_t_5;
12312 
12313  /* "View.MemoryView":539
12314  * info.suboffsets = NULL
12315  *
12316  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12317  * info.format = self.view.format
12318  * else:
12319  */
12320  goto __pyx_L9;
12321  }
12322 
12323  /* "View.MemoryView":542
12324  * info.format = self.view.format
12325  * else:
12326  * info.format = NULL # <<<<<<<<<<<<<<
12327  *
12328  * info.buf = self.view.buf
12329  */
12330  __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
12331  /*else*/ {
12332  __pyx_v_info->format = NULL;
12333  }
12334  __pyx_L9:;
12335 
12336  /* "View.MemoryView":544
12337  * info.format = NULL
12338  *
12339  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12340  * info.ndim = self.view.ndim
12341  * info.itemsize = self.view.itemsize
12342  */
12343  __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
12344  __pyx_t_6 = __pyx_v_self->view.buf;
12345  __pyx_v_info->buf = __pyx_t_6;
12346 
12347  /* "View.MemoryView":545
12348  *
12349  * info.buf = self.view.buf
12350  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12351  * info.itemsize = self.view.itemsize
12352  * info.len = self.view.len
12353  */
12354  __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
12355  __pyx_t_7 = __pyx_v_self->view.ndim;
12356  __pyx_v_info->ndim = __pyx_t_7;
12357 
12358  /* "View.MemoryView":546
12359  * info.buf = self.view.buf
12360  * info.ndim = self.view.ndim
12361  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12362  * info.len = self.view.len
12363  * info.readonly = self.view.readonly
12364  */
12365  __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
12366  __pyx_t_8 = __pyx_v_self->view.itemsize;
12367  __pyx_v_info->itemsize = __pyx_t_8;
12368 
12369  /* "View.MemoryView":547
12370  * info.ndim = self.view.ndim
12371  * info.itemsize = self.view.itemsize
12372  * info.len = self.view.len # <<<<<<<<<<<<<<
12373  * info.readonly = self.view.readonly
12374  * info.obj = self
12375  */
12376  __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
12377  __pyx_t_8 = __pyx_v_self->view.len;
12378  __pyx_v_info->len = __pyx_t_8;
12379 
12380  /* "View.MemoryView":548
12381  * info.itemsize = self.view.itemsize
12382  * info.len = self.view.len
12383  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12384  * info.obj = self
12385  *
12386  */
12387  __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
12388  __pyx_t_1 = __pyx_v_self->view.readonly;
12389  __pyx_v_info->readonly = __pyx_t_1;
12390 
12391  /* "View.MemoryView":549
12392  * info.len = self.view.len
12393  * info.readonly = self.view.readonly
12394  * info.obj = self # <<<<<<<<<<<<<<
12395  *
12396  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12397  */
12398  __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
12399  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12400  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12401  __Pyx_GOTREF(__pyx_v_info->obj);
12402  __Pyx_DECREF(__pyx_v_info->obj);
12403  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12404 
12405  /* "View.MemoryView":520
12406  *
12407  * @cname('getbuffer')
12408  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12409  * if flags & PyBUF_WRITABLE and self.view.readonly:
12410  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12411  */
12412 
12413  /* function exit code */
12414  __pyx_r = 0;
12415  goto __pyx_L0;
12416  __pyx_L1_error:;
12417  __Pyx_XDECREF(__pyx_t_3);
12418  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12419  __pyx_r = -1;
12420  if (__pyx_v_info->obj != NULL) {
12421  __Pyx_GOTREF(__pyx_v_info->obj);
12422  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12423  }
12424  goto __pyx_L2;
12425  __pyx_L0:;
12426  if (__pyx_v_info->obj == Py_None) {
12427  __Pyx_GOTREF(__pyx_v_info->obj);
12428  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12429  }
12430  __pyx_L2:;
12431  __Pyx_TraceReturn(Py_None, 0);
12432  __Pyx_RefNannyFinishContext();
12433  return __pyx_r;
12434 }
12435 
12436 /* "View.MemoryView":555
12437  *
12438  * @property
12439  * def T(self): # <<<<<<<<<<<<<<
12440  * cdef _memoryviewslice result = memoryview_copy(self)
12441  * transpose_memslice(&result.from_slice)
12442  */
12443 
12444 /* Python wrapper */
12445 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12446 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12447  PyObject *__pyx_r = 0;
12448  __Pyx_RefNannyDeclarations
12449  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12450  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12451 
12452  /* function exit code */
12453  __Pyx_RefNannyFinishContext();
12454  return __pyx_r;
12455 }
12456 
12457 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12458  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12459  PyObject *__pyx_r = NULL;
12460  __Pyx_TraceDeclarations
12461  __Pyx_RefNannyDeclarations
12462  PyObject *__pyx_t_1 = NULL;
12463  int __pyx_t_2;
12464  int __pyx_lineno = 0;
12465  const char *__pyx_filename = NULL;
12466  int __pyx_clineno = 0;
12467  __Pyx_RefNannySetupContext("__get__", 0);
12468  __Pyx_TraceCall("__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
12469 
12470  /* "View.MemoryView":556
12471  * @property
12472  * def T(self):
12473  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12474  * transpose_memslice(&result.from_slice)
12475  * return result
12476  */
12477  __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
12478  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
12479  __Pyx_GOTREF(__pyx_t_1);
12480  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
12481  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12482  __pyx_t_1 = 0;
12483 
12484  /* "View.MemoryView":557
12485  * def T(self):
12486  * cdef _memoryviewslice result = memoryview_copy(self)
12487  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12488  * return result
12489  *
12490  */
12491  __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
12492  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
12493 
12494  /* "View.MemoryView":558
12495  * cdef _memoryviewslice result = memoryview_copy(self)
12496  * transpose_memslice(&result.from_slice)
12497  * return result # <<<<<<<<<<<<<<
12498  *
12499  * @property
12500  */
12501  __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
12502  __Pyx_XDECREF(__pyx_r);
12503  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12504  __pyx_r = ((PyObject *)__pyx_v_result);
12505  goto __pyx_L0;
12506 
12507  /* "View.MemoryView":555
12508  *
12509  * @property
12510  * def T(self): # <<<<<<<<<<<<<<
12511  * cdef _memoryviewslice result = memoryview_copy(self)
12512  * transpose_memslice(&result.from_slice)
12513  */
12514 
12515  /* function exit code */
12516  __pyx_L1_error:;
12517  __Pyx_XDECREF(__pyx_t_1);
12518  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12519  __pyx_r = NULL;
12520  __pyx_L0:;
12521  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12522  __Pyx_XGIVEREF(__pyx_r);
12523  __Pyx_TraceReturn(__pyx_r, 0);
12524  __Pyx_RefNannyFinishContext();
12525  return __pyx_r;
12526 }
12527 
12528 /* "View.MemoryView":561
12529  *
12530  * @property
12531  * def base(self): # <<<<<<<<<<<<<<
12532  * return self.obj
12533  *
12534  */
12535 
12536 /* Python wrapper */
12537 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12538 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12539  PyObject *__pyx_r = 0;
12540  __Pyx_RefNannyDeclarations
12541  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12542  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12543 
12544  /* function exit code */
12545  __Pyx_RefNannyFinishContext();
12546  return __pyx_r;
12547 }
12548 
12549 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12550  PyObject *__pyx_r = NULL;
12551  __Pyx_TraceDeclarations
12552  __Pyx_RefNannyDeclarations
12553  int __pyx_lineno = 0;
12554  const char *__pyx_filename = NULL;
12555  int __pyx_clineno = 0;
12556  __Pyx_RefNannySetupContext("__get__", 0);
12557  __Pyx_TraceCall("__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
12558 
12559  /* "View.MemoryView":562
12560  * @property
12561  * def base(self):
12562  * return self.obj # <<<<<<<<<<<<<<
12563  *
12564  * @property
12565  */
12566  __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
12567  __Pyx_XDECREF(__pyx_r);
12568  __Pyx_INCREF(__pyx_v_self->obj);
12569  __pyx_r = __pyx_v_self->obj;
12570  goto __pyx_L0;
12571 
12572  /* "View.MemoryView":561
12573  *
12574  * @property
12575  * def base(self): # <<<<<<<<<<<<<<
12576  * return self.obj
12577  *
12578  */
12579 
12580  /* function exit code */
12581  __pyx_L1_error:;
12582  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12583  __pyx_r = NULL;
12584  __pyx_L0:;
12585  __Pyx_XGIVEREF(__pyx_r);
12586  __Pyx_TraceReturn(__pyx_r, 0);
12587  __Pyx_RefNannyFinishContext();
12588  return __pyx_r;
12589 }
12590 
12591 /* "View.MemoryView":565
12592  *
12593  * @property
12594  * def shape(self): # <<<<<<<<<<<<<<
12595  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12596  *
12597  */
12598 
12599 /* Python wrapper */
12600 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
12601 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12602  PyObject *__pyx_r = 0;
12603  __Pyx_RefNannyDeclarations
12604  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12605  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12606 
12607  /* function exit code */
12608  __Pyx_RefNannyFinishContext();
12609  return __pyx_r;
12610 }
12611 
12612 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12613  Py_ssize_t __pyx_v_length;
12614  PyObject *__pyx_r = NULL;
12615  __Pyx_TraceDeclarations
12616  __Pyx_RefNannyDeclarations
12617  PyObject *__pyx_t_1 = NULL;
12618  Py_ssize_t *__pyx_t_2;
12619  Py_ssize_t *__pyx_t_3;
12620  Py_ssize_t *__pyx_t_4;
12621  PyObject *__pyx_t_5 = NULL;
12622  int __pyx_lineno = 0;
12623  const char *__pyx_filename = NULL;
12624  int __pyx_clineno = 0;
12625  __Pyx_RefNannySetupContext("__get__", 0);
12626  __Pyx_TraceCall("__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
12627 
12628  /* "View.MemoryView":566
12629  * @property
12630  * def shape(self):
12631  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12632  *
12633  * @property
12634  */
12635  __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
12636  __Pyx_XDECREF(__pyx_r);
12637  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
12638  __Pyx_GOTREF(__pyx_t_1);
12639  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12640  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12641  __pyx_t_2 = __pyx_t_4;
12642  __pyx_v_length = (__pyx_t_2[0]);
12643  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12644  __Pyx_GOTREF(__pyx_t_5);
12645  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
12646  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12647  }
12648  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12649  __Pyx_GOTREF(__pyx_t_5);
12650  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12651  __pyx_r = __pyx_t_5;
12652  __pyx_t_5 = 0;
12653  goto __pyx_L0;
12654 
12655  /* "View.MemoryView":565
12656  *
12657  * @property
12658  * def shape(self): # <<<<<<<<<<<<<<
12659  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12660  *
12661  */
12662 
12663  /* function exit code */
12664  __pyx_L1_error:;
12665  __Pyx_XDECREF(__pyx_t_1);
12666  __Pyx_XDECREF(__pyx_t_5);
12667  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12668  __pyx_r = NULL;
12669  __pyx_L0:;
12670  __Pyx_XGIVEREF(__pyx_r);
12671  __Pyx_TraceReturn(__pyx_r, 0);
12672  __Pyx_RefNannyFinishContext();
12673  return __pyx_r;
12674 }
12675 
12676 /* "View.MemoryView":569
12677  *
12678  * @property
12679  * def strides(self): # <<<<<<<<<<<<<<
12680  * if self.view.strides == NULL:
12681  *
12682  */
12683 
12684 /* Python wrapper */
12685 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
12686 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12687  PyObject *__pyx_r = 0;
12688  __Pyx_RefNannyDeclarations
12689  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12690  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12691 
12692  /* function exit code */
12693  __Pyx_RefNannyFinishContext();
12694  return __pyx_r;
12695 }
12696 
12697 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12698  Py_ssize_t __pyx_v_stride;
12699  PyObject *__pyx_r = NULL;
12700  __Pyx_TraceDeclarations
12701  __Pyx_RefNannyDeclarations
12702  int __pyx_t_1;
12703  PyObject *__pyx_t_2 = NULL;
12704  Py_ssize_t *__pyx_t_3;
12705  Py_ssize_t *__pyx_t_4;
12706  Py_ssize_t *__pyx_t_5;
12707  PyObject *__pyx_t_6 = NULL;
12708  int __pyx_lineno = 0;
12709  const char *__pyx_filename = NULL;
12710  int __pyx_clineno = 0;
12711  __Pyx_RefNannySetupContext("__get__", 0);
12712  __Pyx_TraceCall("__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
12713 
12714  /* "View.MemoryView":570
12715  * @property
12716  * def strides(self):
12717  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12718  *
12719  * raise ValueError("Buffer view does not expose strides")
12720  */
12721  __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12722  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12723  if (unlikely(__pyx_t_1)) {
12724 
12725  /* "View.MemoryView":572
12726  * if self.view.strides == NULL:
12727  *
12728  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
12729  *
12730  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12731  */
12732  __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12733  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12734  __Pyx_GOTREF(__pyx_t_2);
12735  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12736  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12737  __PYX_ERR(1, 572, __pyx_L1_error)
12738 
12739  /* "View.MemoryView":570
12740  * @property
12741  * def strides(self):
12742  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12743  *
12744  * raise ValueError("Buffer view does not expose strides")
12745  */
12746  }
12747 
12748  /* "View.MemoryView":574
12749  * raise ValueError("Buffer view does not expose strides")
12750  *
12751  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
12752  *
12753  * @property
12754  */
12755  __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
12756  __Pyx_XDECREF(__pyx_r);
12757  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
12758  __Pyx_GOTREF(__pyx_t_2);
12759  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12760  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12761  __pyx_t_3 = __pyx_t_5;
12762  __pyx_v_stride = (__pyx_t_3[0]);
12763  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12764  __Pyx_GOTREF(__pyx_t_6);
12765  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
12766  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12767  }
12768  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12769  __Pyx_GOTREF(__pyx_t_6);
12770  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12771  __pyx_r = __pyx_t_6;
12772  __pyx_t_6 = 0;
12773  goto __pyx_L0;
12774 
12775  /* "View.MemoryView":569
12776  *
12777  * @property
12778  * def strides(self): # <<<<<<<<<<<<<<
12779  * if self.view.strides == NULL:
12780  *
12781  */
12782 
12783  /* function exit code */
12784  __pyx_L1_error:;
12785  __Pyx_XDECREF(__pyx_t_2);
12786  __Pyx_XDECREF(__pyx_t_6);
12787  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12788  __pyx_r = NULL;
12789  __pyx_L0:;
12790  __Pyx_XGIVEREF(__pyx_r);
12791  __Pyx_TraceReturn(__pyx_r, 0);
12792  __Pyx_RefNannyFinishContext();
12793  return __pyx_r;
12794 }
12795 
12796 /* "View.MemoryView":577
12797  *
12798  * @property
12799  * def suboffsets(self): # <<<<<<<<<<<<<<
12800  * if self.view.suboffsets == NULL:
12801  * return (-1,) * self.view.ndim
12802  */
12803 
12804 /* Python wrapper */
12805 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
12806 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12807  PyObject *__pyx_r = 0;
12808  __Pyx_RefNannyDeclarations
12809  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12810  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12811 
12812  /* function exit code */
12813  __Pyx_RefNannyFinishContext();
12814  return __pyx_r;
12815 }
12816 
12817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12818  Py_ssize_t __pyx_v_suboffset;
12819  PyObject *__pyx_r = NULL;
12820  __Pyx_TraceDeclarations
12821  __Pyx_RefNannyDeclarations
12822  int __pyx_t_1;
12823  PyObject *__pyx_t_2 = NULL;
12824  PyObject *__pyx_t_3 = NULL;
12825  Py_ssize_t *__pyx_t_4;
12826  Py_ssize_t *__pyx_t_5;
12827  Py_ssize_t *__pyx_t_6;
12828  int __pyx_lineno = 0;
12829  const char *__pyx_filename = NULL;
12830  int __pyx_clineno = 0;
12831  __Pyx_RefNannySetupContext("__get__", 0);
12832  __Pyx_TraceCall("__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
12833 
12834  /* "View.MemoryView":578
12835  * @property
12836  * def suboffsets(self):
12837  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12838  * return (-1,) * self.view.ndim
12839  *
12840  */
12841  __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
12842  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12843  if (__pyx_t_1) {
12844 
12845  /* "View.MemoryView":579
12846  * def suboffsets(self):
12847  * if self.view.suboffsets == NULL:
12848  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
12849  *
12850  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12851  */
12852  __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12853  __Pyx_XDECREF(__pyx_r);
12854  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12855  __Pyx_GOTREF(__pyx_t_2);
12856  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12857  __Pyx_GOTREF(__pyx_t_3);
12858  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12859  __pyx_r = __pyx_t_3;
12860  __pyx_t_3 = 0;
12861  goto __pyx_L0;
12862 
12863  /* "View.MemoryView":578
12864  * @property
12865  * def suboffsets(self):
12866  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12867  * return (-1,) * self.view.ndim
12868  *
12869  */
12870  }
12871 
12872  /* "View.MemoryView":581
12873  * return (-1,) * self.view.ndim
12874  *
12875  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
12876  *
12877  * @property
12878  */
12879  __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
12880  __Pyx_XDECREF(__pyx_r);
12881  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
12882  __Pyx_GOTREF(__pyx_t_3);
12883  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12884  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12885  __pyx_t_4 = __pyx_t_6;
12886  __pyx_v_suboffset = (__pyx_t_4[0]);
12887  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12888  __Pyx_GOTREF(__pyx_t_2);
12889  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
12890  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12891  }
12892  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12893  __Pyx_GOTREF(__pyx_t_2);
12894  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12895  __pyx_r = __pyx_t_2;
12896  __pyx_t_2 = 0;
12897  goto __pyx_L0;
12898 
12899  /* "View.MemoryView":577
12900  *
12901  * @property
12902  * def suboffsets(self): # <<<<<<<<<<<<<<
12903  * if self.view.suboffsets == NULL:
12904  * return (-1,) * self.view.ndim
12905  */
12906 
12907  /* function exit code */
12908  __pyx_L1_error:;
12909  __Pyx_XDECREF(__pyx_t_2);
12910  __Pyx_XDECREF(__pyx_t_3);
12911  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12912  __pyx_r = NULL;
12913  __pyx_L0:;
12914  __Pyx_XGIVEREF(__pyx_r);
12915  __Pyx_TraceReturn(__pyx_r, 0);
12916  __Pyx_RefNannyFinishContext();
12917  return __pyx_r;
12918 }
12919 
12920 /* "View.MemoryView":584
12921  *
12922  * @property
12923  * def ndim(self): # <<<<<<<<<<<<<<
12924  * return self.view.ndim
12925  *
12926  */
12927 
12928 /* Python wrapper */
12929 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
12930 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12931  PyObject *__pyx_r = 0;
12932  __Pyx_RefNannyDeclarations
12933  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12934  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12935 
12936  /* function exit code */
12937  __Pyx_RefNannyFinishContext();
12938  return __pyx_r;
12939 }
12940 
12941 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12942  PyObject *__pyx_r = NULL;
12943  __Pyx_TraceDeclarations
12944  __Pyx_RefNannyDeclarations
12945  PyObject *__pyx_t_1 = NULL;
12946  int __pyx_lineno = 0;
12947  const char *__pyx_filename = NULL;
12948  int __pyx_clineno = 0;
12949  __Pyx_RefNannySetupContext("__get__", 0);
12950  __Pyx_TraceCall("__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
12951 
12952  /* "View.MemoryView":585
12953  * @property
12954  * def ndim(self):
12955  * return self.view.ndim # <<<<<<<<<<<<<<
12956  *
12957  * @property
12958  */
12959  __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
12960  __Pyx_XDECREF(__pyx_r);
12961  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
12962  __Pyx_GOTREF(__pyx_t_1);
12963  __pyx_r = __pyx_t_1;
12964  __pyx_t_1 = 0;
12965  goto __pyx_L0;
12966 
12967  /* "View.MemoryView":584
12968  *
12969  * @property
12970  * def ndim(self): # <<<<<<<<<<<<<<
12971  * return self.view.ndim
12972  *
12973  */
12974 
12975  /* function exit code */
12976  __pyx_L1_error:;
12977  __Pyx_XDECREF(__pyx_t_1);
12978  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12979  __pyx_r = NULL;
12980  __pyx_L0:;
12981  __Pyx_XGIVEREF(__pyx_r);
12982  __Pyx_TraceReturn(__pyx_r, 0);
12983  __Pyx_RefNannyFinishContext();
12984  return __pyx_r;
12985 }
12986 
12987 /* "View.MemoryView":588
12988  *
12989  * @property
12990  * def itemsize(self): # <<<<<<<<<<<<<<
12991  * return self.view.itemsize
12992  *
12993  */
12994 
12995 /* Python wrapper */
12996 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
12997 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12998  PyObject *__pyx_r = 0;
12999  __Pyx_RefNannyDeclarations
13000  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13001  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13002 
13003  /* function exit code */
13004  __Pyx_RefNannyFinishContext();
13005  return __pyx_r;
13006 }
13007 
13008 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13009  PyObject *__pyx_r = NULL;
13010  __Pyx_TraceDeclarations
13011  __Pyx_RefNannyDeclarations
13012  PyObject *__pyx_t_1 = NULL;
13013  int __pyx_lineno = 0;
13014  const char *__pyx_filename = NULL;
13015  int __pyx_clineno = 0;
13016  __Pyx_RefNannySetupContext("__get__", 0);
13017  __Pyx_TraceCall("__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
13018 
13019  /* "View.MemoryView":589
13020  * @property
13021  * def itemsize(self):
13022  * return self.view.itemsize # <<<<<<<<<<<<<<
13023  *
13024  * @property
13025  */
13026  __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
13027  __Pyx_XDECREF(__pyx_r);
13028  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
13029  __Pyx_GOTREF(__pyx_t_1);
13030  __pyx_r = __pyx_t_1;
13031  __pyx_t_1 = 0;
13032  goto __pyx_L0;
13033 
13034  /* "View.MemoryView":588
13035  *
13036  * @property
13037  * def itemsize(self): # <<<<<<<<<<<<<<
13038  * return self.view.itemsize
13039  *
13040  */
13041 
13042  /* function exit code */
13043  __pyx_L1_error:;
13044  __Pyx_XDECREF(__pyx_t_1);
13045  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13046  __pyx_r = NULL;
13047  __pyx_L0:;
13048  __Pyx_XGIVEREF(__pyx_r);
13049  __Pyx_TraceReturn(__pyx_r, 0);
13050  __Pyx_RefNannyFinishContext();
13051  return __pyx_r;
13052 }
13053 
13054 /* "View.MemoryView":592
13055  *
13056  * @property
13057  * def nbytes(self): # <<<<<<<<<<<<<<
13058  * return self.size * self.view.itemsize
13059  *
13060  */
13061 
13062 /* Python wrapper */
13063 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13064 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13065  PyObject *__pyx_r = 0;
13066  __Pyx_RefNannyDeclarations
13067  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13068  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13069 
13070  /* function exit code */
13071  __Pyx_RefNannyFinishContext();
13072  return __pyx_r;
13073 }
13074 
13075 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13076  PyObject *__pyx_r = NULL;
13077  __Pyx_TraceDeclarations
13078  __Pyx_RefNannyDeclarations
13079  PyObject *__pyx_t_1 = NULL;
13080  PyObject *__pyx_t_2 = NULL;
13081  PyObject *__pyx_t_3 = NULL;
13082  int __pyx_lineno = 0;
13083  const char *__pyx_filename = NULL;
13084  int __pyx_clineno = 0;
13085  __Pyx_RefNannySetupContext("__get__", 0);
13086  __Pyx_TraceCall("__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
13087 
13088  /* "View.MemoryView":593
13089  * @property
13090  * def nbytes(self):
13091  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13092  *
13093  * @property
13094  */
13095  __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
13096  __Pyx_XDECREF(__pyx_r);
13097  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
13098  __Pyx_GOTREF(__pyx_t_1);
13099  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
13100  __Pyx_GOTREF(__pyx_t_2);
13101  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
13102  __Pyx_GOTREF(__pyx_t_3);
13103  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13104  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13105  __pyx_r = __pyx_t_3;
13106  __pyx_t_3 = 0;
13107  goto __pyx_L0;
13108 
13109  /* "View.MemoryView":592
13110  *
13111  * @property
13112  * def nbytes(self): # <<<<<<<<<<<<<<
13113  * return self.size * self.view.itemsize
13114  *
13115  */
13116 
13117  /* function exit code */
13118  __pyx_L1_error:;
13119  __Pyx_XDECREF(__pyx_t_1);
13120  __Pyx_XDECREF(__pyx_t_2);
13121  __Pyx_XDECREF(__pyx_t_3);
13122  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13123  __pyx_r = NULL;
13124  __pyx_L0:;
13125  __Pyx_XGIVEREF(__pyx_r);
13126  __Pyx_TraceReturn(__pyx_r, 0);
13127  __Pyx_RefNannyFinishContext();
13128  return __pyx_r;
13129 }
13130 
13131 /* "View.MemoryView":596
13132  *
13133  * @property
13134  * def size(self): # <<<<<<<<<<<<<<
13135  * if self._size is None:
13136  * result = 1
13137  */
13138 
13139 /* Python wrapper */
13140 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13141 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13142  PyObject *__pyx_r = 0;
13143  __Pyx_RefNannyDeclarations
13144  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13145  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13146 
13147  /* function exit code */
13148  __Pyx_RefNannyFinishContext();
13149  return __pyx_r;
13150 }
13151 
13152 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13153  PyObject *__pyx_v_result = NULL;
13154  PyObject *__pyx_v_length = NULL;
13155  PyObject *__pyx_r = NULL;
13156  __Pyx_TraceDeclarations
13157  __Pyx_RefNannyDeclarations
13158  int __pyx_t_1;
13159  int __pyx_t_2;
13160  Py_ssize_t *__pyx_t_3;
13161  Py_ssize_t *__pyx_t_4;
13162  Py_ssize_t *__pyx_t_5;
13163  PyObject *__pyx_t_6 = NULL;
13164  int __pyx_lineno = 0;
13165  const char *__pyx_filename = NULL;
13166  int __pyx_clineno = 0;
13167  __Pyx_RefNannySetupContext("__get__", 0);
13168  __Pyx_TraceCall("__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
13169 
13170  /* "View.MemoryView":597
13171  * @property
13172  * def size(self):
13173  * if self._size is None: # <<<<<<<<<<<<<<
13174  * result = 1
13175  *
13176  */
13177  __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
13178  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13179  __pyx_t_2 = (__pyx_t_1 != 0);
13180  if (__pyx_t_2) {
13181 
13182  /* "View.MemoryView":598
13183  * def size(self):
13184  * if self._size is None:
13185  * result = 1 # <<<<<<<<<<<<<<
13186  *
13187  * for length in self.view.shape[:self.view.ndim]:
13188  */
13189  __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
13190  __Pyx_INCREF(__pyx_int_1);
13191  __pyx_v_result = __pyx_int_1;
13192 
13193  /* "View.MemoryView":600
13194  * result = 1
13195  *
13196  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13197  * result *= length
13198  *
13199  */
13200  __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
13201  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13202  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13203  __pyx_t_3 = __pyx_t_5;
13204  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
13205  __Pyx_GOTREF(__pyx_t_6);
13206  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13207  __pyx_t_6 = 0;
13208 
13209  /* "View.MemoryView":601
13210  *
13211  * for length in self.view.shape[:self.view.ndim]:
13212  * result *= length # <<<<<<<<<<<<<<
13213  *
13214  * self._size = result
13215  */
13216  __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
13217  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
13218  __Pyx_GOTREF(__pyx_t_6);
13219  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13220  __pyx_t_6 = 0;
13221  }
13222 
13223  /* "View.MemoryView":603
13224  * result *= length
13225  *
13226  * self._size = result # <<<<<<<<<<<<<<
13227  *
13228  * return self._size
13229  */
13230  __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
13231  __Pyx_INCREF(__pyx_v_result);
13232  __Pyx_GIVEREF(__pyx_v_result);
13233  __Pyx_GOTREF(__pyx_v_self->_size);
13234  __Pyx_DECREF(__pyx_v_self->_size);
13235  __pyx_v_self->_size = __pyx_v_result;
13236 
13237  /* "View.MemoryView":597
13238  * @property
13239  * def size(self):
13240  * if self._size is None: # <<<<<<<<<<<<<<
13241  * result = 1
13242  *
13243  */
13244  }
13245 
13246  /* "View.MemoryView":605
13247  * self._size = result
13248  *
13249  * return self._size # <<<<<<<<<<<<<<
13250  *
13251  * def __len__(self):
13252  */
13253  __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
13254  __Pyx_XDECREF(__pyx_r);
13255  __Pyx_INCREF(__pyx_v_self->_size);
13256  __pyx_r = __pyx_v_self->_size;
13257  goto __pyx_L0;
13258 
13259  /* "View.MemoryView":596
13260  *
13261  * @property
13262  * def size(self): # <<<<<<<<<<<<<<
13263  * if self._size is None:
13264  * result = 1
13265  */
13266 
13267  /* function exit code */
13268  __pyx_L1_error:;
13269  __Pyx_XDECREF(__pyx_t_6);
13270  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13271  __pyx_r = NULL;
13272  __pyx_L0:;
13273  __Pyx_XDECREF(__pyx_v_result);
13274  __Pyx_XDECREF(__pyx_v_length);
13275  __Pyx_XGIVEREF(__pyx_r);
13276  __Pyx_TraceReturn(__pyx_r, 0);
13277  __Pyx_RefNannyFinishContext();
13278  return __pyx_r;
13279 }
13280 
13281 /* "View.MemoryView":607
13282  * return self._size
13283  *
13284  * def __len__(self): # <<<<<<<<<<<<<<
13285  * if self.view.ndim >= 1:
13286  * return self.view.shape[0]
13287  */
13288 
13289 /* Python wrapper */
13290 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13291 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13292  Py_ssize_t __pyx_r;
13293  __Pyx_RefNannyDeclarations
13294  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13295  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13296 
13297  /* function exit code */
13298  __Pyx_RefNannyFinishContext();
13299  return __pyx_r;
13300 }
13301 
13302 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13303  Py_ssize_t __pyx_r;
13304  __Pyx_TraceDeclarations
13305  __Pyx_RefNannyDeclarations
13306  int __pyx_t_1;
13307  int __pyx_lineno = 0;
13308  const char *__pyx_filename = NULL;
13309  int __pyx_clineno = 0;
13310  __Pyx_RefNannySetupContext("__len__", 0);
13311  __Pyx_TraceCall("__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
13312 
13313  /* "View.MemoryView":608
13314  *
13315  * def __len__(self):
13316  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13317  * return self.view.shape[0]
13318  *
13319  */
13320  __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
13321  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13322  if (__pyx_t_1) {
13323 
13324  /* "View.MemoryView":609
13325  * def __len__(self):
13326  * if self.view.ndim >= 1:
13327  * return self.view.shape[0] # <<<<<<<<<<<<<<
13328  *
13329  * return 0
13330  */
13331  __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
13332  __pyx_r = (__pyx_v_self->view.shape[0]);
13333  goto __pyx_L0;
13334 
13335  /* "View.MemoryView":608
13336  *
13337  * def __len__(self):
13338  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13339  * return self.view.shape[0]
13340  *
13341  */
13342  }
13343 
13344  /* "View.MemoryView":611
13345  * return self.view.shape[0]
13346  *
13347  * return 0 # <<<<<<<<<<<<<<
13348  *
13349  * def __repr__(self):
13350  */
13351  __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
13352  __pyx_r = 0;
13353  goto __pyx_L0;
13354 
13355  /* "View.MemoryView":607
13356  * return self._size
13357  *
13358  * def __len__(self): # <<<<<<<<<<<<<<
13359  * if self.view.ndim >= 1:
13360  * return self.view.shape[0]
13361  */
13362 
13363  /* function exit code */
13364  __pyx_L1_error:;
13365  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13366  __pyx_r = -1;
13367  __pyx_L0:;
13368  __Pyx_TraceReturn(Py_None, 0);
13369  __Pyx_RefNannyFinishContext();
13370  return __pyx_r;
13371 }
13372 
13373 /* "View.MemoryView":613
13374  * return 0
13375  *
13376  * def __repr__(self): # <<<<<<<<<<<<<<
13377  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13378  * id(self))
13379  */
13380 
13381 /* Python wrapper */
13382 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13383 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13384  PyObject *__pyx_r = 0;
13385  __Pyx_RefNannyDeclarations
13386  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13387  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13388 
13389  /* function exit code */
13390  __Pyx_RefNannyFinishContext();
13391  return __pyx_r;
13392 }
13393 
13394 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13395  PyObject *__pyx_r = NULL;
13396  __Pyx_TraceDeclarations
13397  __Pyx_RefNannyDeclarations
13398  PyObject *__pyx_t_1 = NULL;
13399  PyObject *__pyx_t_2 = NULL;
13400  PyObject *__pyx_t_3 = NULL;
13401  int __pyx_lineno = 0;
13402  const char *__pyx_filename = NULL;
13403  int __pyx_clineno = 0;
13404  __Pyx_RefNannySetupContext("__repr__", 0);
13405  __Pyx_TraceCall("__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
13406 
13407  /* "View.MemoryView":614
13408  *
13409  * def __repr__(self):
13410  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13411  * id(self))
13412  *
13413  */
13414  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13415  __Pyx_XDECREF(__pyx_r);
13416  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13417  __Pyx_GOTREF(__pyx_t_1);
13418  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13419  __Pyx_GOTREF(__pyx_t_2);
13420  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13421  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13422  __Pyx_GOTREF(__pyx_t_1);
13423  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13424 
13425  /* "View.MemoryView":615
13426  * def __repr__(self):
13427  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13428  * id(self)) # <<<<<<<<<<<<<<
13429  *
13430  * def __str__(self):
13431  */
13432  __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
13433  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
13434  __Pyx_GOTREF(__pyx_t_2);
13435 
13436  /* "View.MemoryView":614
13437  *
13438  * def __repr__(self):
13439  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13440  * id(self))
13441  *
13442  */
13443  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13444  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
13445  __Pyx_GOTREF(__pyx_t_3);
13446  __Pyx_GIVEREF(__pyx_t_1);
13447  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13448  __Pyx_GIVEREF(__pyx_t_2);
13449  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13450  __pyx_t_1 = 0;
13451  __pyx_t_2 = 0;
13452  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13453  __Pyx_GOTREF(__pyx_t_2);
13454  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13455  __pyx_r = __pyx_t_2;
13456  __pyx_t_2 = 0;
13457  goto __pyx_L0;
13458 
13459  /* "View.MemoryView":613
13460  * return 0
13461  *
13462  * def __repr__(self): # <<<<<<<<<<<<<<
13463  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13464  * id(self))
13465  */
13466 
13467  /* function exit code */
13468  __pyx_L1_error:;
13469  __Pyx_XDECREF(__pyx_t_1);
13470  __Pyx_XDECREF(__pyx_t_2);
13471  __Pyx_XDECREF(__pyx_t_3);
13472  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13473  __pyx_r = NULL;
13474  __pyx_L0:;
13475  __Pyx_XGIVEREF(__pyx_r);
13476  __Pyx_TraceReturn(__pyx_r, 0);
13477  __Pyx_RefNannyFinishContext();
13478  return __pyx_r;
13479 }
13480 
13481 /* "View.MemoryView":617
13482  * id(self))
13483  *
13484  * def __str__(self): # <<<<<<<<<<<<<<
13485  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13486  *
13487  */
13488 
13489 /* Python wrapper */
13490 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13491 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13492  PyObject *__pyx_r = 0;
13493  __Pyx_RefNannyDeclarations
13494  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13495  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13496 
13497  /* function exit code */
13498  __Pyx_RefNannyFinishContext();
13499  return __pyx_r;
13500 }
13501 
13502 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13503  PyObject *__pyx_r = NULL;
13504  __Pyx_TraceDeclarations
13505  __Pyx_RefNannyDeclarations
13506  PyObject *__pyx_t_1 = NULL;
13507  PyObject *__pyx_t_2 = NULL;
13508  int __pyx_lineno = 0;
13509  const char *__pyx_filename = NULL;
13510  int __pyx_clineno = 0;
13511  __Pyx_RefNannySetupContext("__str__", 0);
13512  __Pyx_TraceCall("__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
13513 
13514  /* "View.MemoryView":618
13515  *
13516  * def __str__(self):
13517  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13518  *
13519  *
13520  */
13521  __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
13522  __Pyx_XDECREF(__pyx_r);
13523  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13524  __Pyx_GOTREF(__pyx_t_1);
13525  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13526  __Pyx_GOTREF(__pyx_t_2);
13527  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13528  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13529  __Pyx_GOTREF(__pyx_t_1);
13530  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13531  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13532  __Pyx_GOTREF(__pyx_t_2);
13533  __Pyx_GIVEREF(__pyx_t_1);
13534  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13535  __pyx_t_1 = 0;
13536  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13537  __Pyx_GOTREF(__pyx_t_1);
13538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13539  __pyx_r = __pyx_t_1;
13540  __pyx_t_1 = 0;
13541  goto __pyx_L0;
13542 
13543  /* "View.MemoryView":617
13544  * id(self))
13545  *
13546  * def __str__(self): # <<<<<<<<<<<<<<
13547  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13548  *
13549  */
13550 
13551  /* function exit code */
13552  __pyx_L1_error:;
13553  __Pyx_XDECREF(__pyx_t_1);
13554  __Pyx_XDECREF(__pyx_t_2);
13555  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13556  __pyx_r = NULL;
13557  __pyx_L0:;
13558  __Pyx_XGIVEREF(__pyx_r);
13559  __Pyx_TraceReturn(__pyx_r, 0);
13560  __Pyx_RefNannyFinishContext();
13561  return __pyx_r;
13562 }
13563 
13564 /* "View.MemoryView":621
13565  *
13566  *
13567  * def is_c_contig(self): # <<<<<<<<<<<<<<
13568  * cdef __Pyx_memviewslice *mslice
13569  * cdef __Pyx_memviewslice tmp
13570  */
13571 
13572 /* Python wrapper */
13573 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13574 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13575 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13576  PyObject *__pyx_r = 0;
13577  __Pyx_RefNannyDeclarations
13578  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13579  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13580 
13581  /* function exit code */
13582  __Pyx_RefNannyFinishContext();
13583  return __pyx_r;
13584 }
13585 
13586 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13587  __Pyx_memviewslice *__pyx_v_mslice;
13588  __Pyx_memviewslice __pyx_v_tmp;
13589  PyObject *__pyx_r = NULL;
13590  __Pyx_TraceDeclarations
13591  __Pyx_RefNannyDeclarations
13592  __Pyx_memviewslice *__pyx_t_1;
13593  PyObject *__pyx_t_2 = NULL;
13594  int __pyx_lineno = 0;
13595  const char *__pyx_filename = NULL;
13596  int __pyx_clineno = 0;
13597  __Pyx_RefNannySetupContext("is_c_contig", 0);
13598  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
13599 
13600  /* "View.MemoryView":624
13601  * cdef __Pyx_memviewslice *mslice
13602  * cdef __Pyx_memviewslice tmp
13603  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13604  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13605  *
13606  */
13607  __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
13608  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
13609  __pyx_v_mslice = __pyx_t_1;
13610 
13611  /* "View.MemoryView":625
13612  * cdef __Pyx_memviewslice tmp
13613  * mslice = get_slice_from_memview(self, &tmp)
13614  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13615  *
13616  * def is_f_contig(self):
13617  */
13618  __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
13619  __Pyx_XDECREF(__pyx_r);
13620  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
13621  __Pyx_GOTREF(__pyx_t_2);
13622  __pyx_r = __pyx_t_2;
13623  __pyx_t_2 = 0;
13624  goto __pyx_L0;
13625 
13626  /* "View.MemoryView":621
13627  *
13628  *
13629  * def is_c_contig(self): # <<<<<<<<<<<<<<
13630  * cdef __Pyx_memviewslice *mslice
13631  * cdef __Pyx_memviewslice tmp
13632  */
13633 
13634  /* function exit code */
13635  __pyx_L1_error:;
13636  __Pyx_XDECREF(__pyx_t_2);
13637  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13638  __pyx_r = NULL;
13639  __pyx_L0:;
13640  __Pyx_XGIVEREF(__pyx_r);
13641  __Pyx_TraceReturn(__pyx_r, 0);
13642  __Pyx_RefNannyFinishContext();
13643  return __pyx_r;
13644 }
13645 
13646 /* "View.MemoryView":627
13647  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13648  *
13649  * def is_f_contig(self): # <<<<<<<<<<<<<<
13650  * cdef __Pyx_memviewslice *mslice
13651  * cdef __Pyx_memviewslice tmp
13652  */
13653 
13654 /* Python wrapper */
13655 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13656 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13657 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13658  PyObject *__pyx_r = 0;
13659  __Pyx_RefNannyDeclarations
13660  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13661  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13662 
13663  /* function exit code */
13664  __Pyx_RefNannyFinishContext();
13665  return __pyx_r;
13666 }
13667 
13668 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13669  __Pyx_memviewslice *__pyx_v_mslice;
13670  __Pyx_memviewslice __pyx_v_tmp;
13671  PyObject *__pyx_r = NULL;
13672  __Pyx_TraceDeclarations
13673  __Pyx_RefNannyDeclarations
13674  __Pyx_memviewslice *__pyx_t_1;
13675  PyObject *__pyx_t_2 = NULL;
13676  int __pyx_lineno = 0;
13677  const char *__pyx_filename = NULL;
13678  int __pyx_clineno = 0;
13679  __Pyx_RefNannySetupContext("is_f_contig", 0);
13680  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
13681 
13682  /* "View.MemoryView":630
13683  * cdef __Pyx_memviewslice *mslice
13684  * cdef __Pyx_memviewslice tmp
13685  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13686  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13687  *
13688  */
13689  __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
13690  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
13691  __pyx_v_mslice = __pyx_t_1;
13692 
13693  /* "View.MemoryView":631
13694  * cdef __Pyx_memviewslice tmp
13695  * mslice = get_slice_from_memview(self, &tmp)
13696  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13697  *
13698  * def copy(self):
13699  */
13700  __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
13701  __Pyx_XDECREF(__pyx_r);
13702  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
13703  __Pyx_GOTREF(__pyx_t_2);
13704  __pyx_r = __pyx_t_2;
13705  __pyx_t_2 = 0;
13706  goto __pyx_L0;
13707 
13708  /* "View.MemoryView":627
13709  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13710  *
13711  * def is_f_contig(self): # <<<<<<<<<<<<<<
13712  * cdef __Pyx_memviewslice *mslice
13713  * cdef __Pyx_memviewslice tmp
13714  */
13715 
13716  /* function exit code */
13717  __pyx_L1_error:;
13718  __Pyx_XDECREF(__pyx_t_2);
13719  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13720  __pyx_r = NULL;
13721  __pyx_L0:;
13722  __Pyx_XGIVEREF(__pyx_r);
13723  __Pyx_TraceReturn(__pyx_r, 0);
13724  __Pyx_RefNannyFinishContext();
13725  return __pyx_r;
13726 }
13727 
13728 /* "View.MemoryView":633
13729  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13730  *
13731  * def copy(self): # <<<<<<<<<<<<<<
13732  * cdef __Pyx_memviewslice mslice
13733  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13734  */
13735 
13736 /* Python wrapper */
13737 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13738 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13739 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13740  PyObject *__pyx_r = 0;
13741  __Pyx_RefNannyDeclarations
13742  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13743  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13744 
13745  /* function exit code */
13746  __Pyx_RefNannyFinishContext();
13747  return __pyx_r;
13748 }
13749 
13750 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13751  __Pyx_memviewslice __pyx_v_mslice;
13752  int __pyx_v_flags;
13753  PyObject *__pyx_r = NULL;
13754  __Pyx_TraceDeclarations
13755  __Pyx_RefNannyDeclarations
13756  __Pyx_memviewslice __pyx_t_1;
13757  PyObject *__pyx_t_2 = NULL;
13758  int __pyx_lineno = 0;
13759  const char *__pyx_filename = NULL;
13760  int __pyx_clineno = 0;
13761  __Pyx_RefNannySetupContext("copy", 0);
13762  __Pyx_TraceCall("copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
13763 
13764  /* "View.MemoryView":635
13765  * def copy(self):
13766  * cdef __Pyx_memviewslice mslice
13767  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13768  *
13769  * slice_copy(self, &mslice)
13770  */
13771  __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13772  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13773 
13774  /* "View.MemoryView":637
13775  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13776  *
13777  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13778  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13779  * self.view.itemsize,
13780  */
13781  __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
13782  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13783 
13784  /* "View.MemoryView":638
13785  *
13786  * slice_copy(self, &mslice)
13787  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
13788  * self.view.itemsize,
13789  * flags|PyBUF_C_CONTIGUOUS,
13790  */
13791  __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
13792  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
13793  __pyx_v_mslice = __pyx_t_1;
13794 
13795  /* "View.MemoryView":643
13796  * self.dtype_is_object)
13797  *
13798  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13799  *
13800  * def copy_fortran(self):
13801  */
13802  __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
13803  __Pyx_XDECREF(__pyx_r);
13804  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
13805  __Pyx_GOTREF(__pyx_t_2);
13806  __pyx_r = __pyx_t_2;
13807  __pyx_t_2 = 0;
13808  goto __pyx_L0;
13809 
13810  /* "View.MemoryView":633
13811  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13812  *
13813  * def copy(self): # <<<<<<<<<<<<<<
13814  * cdef __Pyx_memviewslice mslice
13815  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13816  */
13817 
13818  /* function exit code */
13819  __pyx_L1_error:;
13820  __Pyx_XDECREF(__pyx_t_2);
13821  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13822  __pyx_r = NULL;
13823  __pyx_L0:;
13824  __Pyx_XGIVEREF(__pyx_r);
13825  __Pyx_TraceReturn(__pyx_r, 0);
13826  __Pyx_RefNannyFinishContext();
13827  return __pyx_r;
13828 }
13829 
13830 /* "View.MemoryView":645
13831  * return memoryview_copy_from_slice(self, &mslice)
13832  *
13833  * def copy_fortran(self): # <<<<<<<<<<<<<<
13834  * cdef __Pyx_memviewslice src, dst
13835  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13836  */
13837 
13838 /* Python wrapper */
13839 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13840 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13841 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13842  PyObject *__pyx_r = 0;
13843  __Pyx_RefNannyDeclarations
13844  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
13845  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
13846 
13847  /* function exit code */
13848  __Pyx_RefNannyFinishContext();
13849  return __pyx_r;
13850 }
13851 
13852 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
13853  __Pyx_memviewslice __pyx_v_src;
13854  __Pyx_memviewslice __pyx_v_dst;
13855  int __pyx_v_flags;
13856  PyObject *__pyx_r = NULL;
13857  __Pyx_TraceDeclarations
13858  __Pyx_RefNannyDeclarations
13859  __Pyx_memviewslice __pyx_t_1;
13860  PyObject *__pyx_t_2 = NULL;
13861  int __pyx_lineno = 0;
13862  const char *__pyx_filename = NULL;
13863  int __pyx_clineno = 0;
13864  __Pyx_RefNannySetupContext("copy_fortran", 0);
13865  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
13866 
13867  /* "View.MemoryView":647
13868  * def copy_fortran(self):
13869  * cdef __Pyx_memviewslice src, dst
13870  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
13871  *
13872  * slice_copy(self, &src)
13873  */
13874  __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13875  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13876 
13877  /* "View.MemoryView":649
13878  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13879  *
13880  * slice_copy(self, &src) # <<<<<<<<<<<<<<
13881  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13882  * self.view.itemsize,
13883  */
13884  __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
13885  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13886 
13887  /* "View.MemoryView":650
13888  *
13889  * slice_copy(self, &src)
13890  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
13891  * self.view.itemsize,
13892  * flags|PyBUF_F_CONTIGUOUS,
13893  */
13894  __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
13895  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
13896  __pyx_v_dst = __pyx_t_1;
13897 
13898  /* "View.MemoryView":655
13899  * self.dtype_is_object)
13900  *
13901  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
13902  *
13903  *
13904  */
13905  __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
13906  __Pyx_XDECREF(__pyx_r);
13907  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
13908  __Pyx_GOTREF(__pyx_t_2);
13909  __pyx_r = __pyx_t_2;
13910  __pyx_t_2 = 0;
13911  goto __pyx_L0;
13912 
13913  /* "View.MemoryView":645
13914  * return memoryview_copy_from_slice(self, &mslice)
13915  *
13916  * def copy_fortran(self): # <<<<<<<<<<<<<<
13917  * cdef __Pyx_memviewslice src, dst
13918  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13919  */
13920 
13921  /* function exit code */
13922  __pyx_L1_error:;
13923  __Pyx_XDECREF(__pyx_t_2);
13924  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13925  __pyx_r = NULL;
13926  __pyx_L0:;
13927  __Pyx_XGIVEREF(__pyx_r);
13928  __Pyx_TraceReturn(__pyx_r, 0);
13929  __Pyx_RefNannyFinishContext();
13930  return __pyx_r;
13931 }
13932 
13933 /* "(tree fragment)":1
13934  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13935  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13936  * def __setstate_cython__(self, __pyx_state):
13937  */
13938 
13939 /* Python wrapper */
13940 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13941 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13942 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13943  PyObject *__pyx_r = 0;
13944  __Pyx_RefNannyDeclarations
13945  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13946  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13947 
13948  /* function exit code */
13949  __Pyx_RefNannyFinishContext();
13950  return __pyx_r;
13951 }
13952 
13953 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
13954  PyObject *__pyx_r = NULL;
13955  __Pyx_TraceDeclarations
13956  __Pyx_RefNannyDeclarations
13957  PyObject *__pyx_t_1 = NULL;
13958  int __pyx_lineno = 0;
13959  const char *__pyx_filename = NULL;
13960  int __pyx_clineno = 0;
13961  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13962  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13963 
13964  /* "(tree fragment)":2
13965  * def __reduce_cython__(self):
13966  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13967  * def __setstate_cython__(self, __pyx_state):
13968  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13969  */
13970  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13971  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13972  __Pyx_GOTREF(__pyx_t_1);
13973  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13974  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13975  __PYX_ERR(1, 2, __pyx_L1_error)
13976 
13977  /* "(tree fragment)":1
13978  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13979  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13980  * def __setstate_cython__(self, __pyx_state):
13981  */
13982 
13983  /* function exit code */
13984  __pyx_L1_error:;
13985  __Pyx_XDECREF(__pyx_t_1);
13986  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13987  __pyx_r = NULL;
13988  __Pyx_XGIVEREF(__pyx_r);
13989  __Pyx_TraceReturn(__pyx_r, 0);
13990  __Pyx_RefNannyFinishContext();
13991  return __pyx_r;
13992 }
13993 
13994 /* "(tree fragment)":3
13995  * def __reduce_cython__(self):
13996  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13997  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13998  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13999  */
14000 
14001 /* Python wrapper */
14002 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14003 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14004 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14005  PyObject *__pyx_r = 0;
14006  __Pyx_RefNannyDeclarations
14007  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14008  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14009 
14010  /* function exit code */
14011  __Pyx_RefNannyFinishContext();
14012  return __pyx_r;
14013 }
14014 
14015 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14016  PyObject *__pyx_r = NULL;
14017  __Pyx_TraceDeclarations
14018  __Pyx_RefNannyDeclarations
14019  PyObject *__pyx_t_1 = NULL;
14020  int __pyx_lineno = 0;
14021  const char *__pyx_filename = NULL;
14022  int __pyx_clineno = 0;
14023  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14024  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14025 
14026  /* "(tree fragment)":4
14027  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14028  * def __setstate_cython__(self, __pyx_state):
14029  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14030  */
14031  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
14032  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14033  __Pyx_GOTREF(__pyx_t_1);
14034  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14035  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14036  __PYX_ERR(1, 4, __pyx_L1_error)
14037 
14038  /* "(tree fragment)":3
14039  * def __reduce_cython__(self):
14040  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14041  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14042  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14043  */
14044 
14045  /* function exit code */
14046  __pyx_L1_error:;
14047  __Pyx_XDECREF(__pyx_t_1);
14048  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14049  __pyx_r = NULL;
14050  __Pyx_XGIVEREF(__pyx_r);
14051  __Pyx_TraceReturn(__pyx_r, 0);
14052  __Pyx_RefNannyFinishContext();
14053  return __pyx_r;
14054 }
14055 
14056 /* "View.MemoryView":659
14057  *
14058  * @cname('__pyx_memoryview_new')
14059  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14060  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14061  * result.typeinfo = typeinfo
14062  */
14063 
14064 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14065  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14066  PyObject *__pyx_r = NULL;
14067  __Pyx_TraceDeclarations
14068  __Pyx_RefNannyDeclarations
14069  PyObject *__pyx_t_1 = NULL;
14070  PyObject *__pyx_t_2 = NULL;
14071  PyObject *__pyx_t_3 = NULL;
14072  int __pyx_lineno = 0;
14073  const char *__pyx_filename = NULL;
14074  int __pyx_clineno = 0;
14075  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14076  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
14077 
14078  /* "View.MemoryView":660
14079  * @cname('__pyx_memoryview_new')
14080  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14081  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14082  * result.typeinfo = typeinfo
14083  * return result
14084  */
14085  __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
14086  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
14087  __Pyx_GOTREF(__pyx_t_1);
14088  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14089  __Pyx_GOTREF(__pyx_t_2);
14090  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
14091  __Pyx_GOTREF(__pyx_t_3);
14092  __Pyx_INCREF(__pyx_v_o);
14093  __Pyx_GIVEREF(__pyx_v_o);
14094  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14095  __Pyx_GIVEREF(__pyx_t_1);
14096  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14097  __Pyx_GIVEREF(__pyx_t_2);
14098  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14099  __pyx_t_1 = 0;
14100  __pyx_t_2 = 0;
14101  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14102  __Pyx_GOTREF(__pyx_t_2);
14103  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14104  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14105  __pyx_t_2 = 0;
14106 
14107  /* "View.MemoryView":661
14108  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14109  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14110  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14111  * return result
14112  *
14113  */
14114  __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
14115  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14116 
14117  /* "View.MemoryView":662
14118  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14119  * result.typeinfo = typeinfo
14120  * return result # <<<<<<<<<<<<<<
14121  *
14122  * @cname('__pyx_memoryview_check')
14123  */
14124  __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
14125  __Pyx_XDECREF(__pyx_r);
14126  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14127  __pyx_r = ((PyObject *)__pyx_v_result);
14128  goto __pyx_L0;
14129 
14130  /* "View.MemoryView":659
14131  *
14132  * @cname('__pyx_memoryview_new')
14133  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14134  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14135  * result.typeinfo = typeinfo
14136  */
14137 
14138  /* function exit code */
14139  __pyx_L1_error:;
14140  __Pyx_XDECREF(__pyx_t_1);
14141  __Pyx_XDECREF(__pyx_t_2);
14142  __Pyx_XDECREF(__pyx_t_3);
14143  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14144  __pyx_r = 0;
14145  __pyx_L0:;
14146  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14147  __Pyx_XGIVEREF(__pyx_r);
14148  __Pyx_TraceReturn(__pyx_r, 0);
14149  __Pyx_RefNannyFinishContext();
14150  return __pyx_r;
14151 }
14152 
14153 /* "View.MemoryView":665
14154  *
14155  * @cname('__pyx_memoryview_check')
14156  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14157  * return isinstance(o, memoryview)
14158  *
14159  */
14160 
14161 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14162  int __pyx_r;
14163  __Pyx_TraceDeclarations
14164  __Pyx_RefNannyDeclarations
14165  int __pyx_t_1;
14166  int __pyx_lineno = 0;
14167  const char *__pyx_filename = NULL;
14168  int __pyx_clineno = 0;
14169  __Pyx_RefNannySetupContext("memoryview_check", 0);
14170  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
14171 
14172  /* "View.MemoryView":666
14173  * @cname('__pyx_memoryview_check')
14174  * cdef inline bint memoryview_check(object o):
14175  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14176  *
14177  * cdef tuple _unellipsify(object index, int ndim):
14178  */
14179  __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
14180  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14181  __pyx_r = __pyx_t_1;
14182  goto __pyx_L0;
14183 
14184  /* "View.MemoryView":665
14185  *
14186  * @cname('__pyx_memoryview_check')
14187  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14188  * return isinstance(o, memoryview)
14189  *
14190  */
14191 
14192  /* function exit code */
14193  __pyx_L1_error:;
14194  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14195  __pyx_r = 0;
14196  __pyx_L0:;
14197  __Pyx_TraceReturn(Py_None, 0);
14198  __Pyx_RefNannyFinishContext();
14199  return __pyx_r;
14200 }
14201 
14202 /* "View.MemoryView":668
14203  * return isinstance(o, memoryview)
14204  *
14205  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14206  * """
14207  * Replace all ellipses with full slices and fill incomplete indices with
14208  */
14209 
14210 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14211  PyObject *__pyx_v_tup = NULL;
14212  PyObject *__pyx_v_result = NULL;
14213  int __pyx_v_have_slices;
14214  int __pyx_v_seen_ellipsis;
14215  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14216  PyObject *__pyx_v_item = NULL;
14217  Py_ssize_t __pyx_v_nslices;
14218  PyObject *__pyx_r = NULL;
14219  __Pyx_TraceDeclarations
14220  __Pyx_RefNannyDeclarations
14221  int __pyx_t_1;
14222  int __pyx_t_2;
14223  PyObject *__pyx_t_3 = NULL;
14224  PyObject *__pyx_t_4 = NULL;
14225  Py_ssize_t __pyx_t_5;
14226  PyObject *(*__pyx_t_6)(PyObject *);
14227  PyObject *__pyx_t_7 = NULL;
14228  Py_ssize_t __pyx_t_8;
14229  int __pyx_t_9;
14230  int __pyx_t_10;
14231  PyObject *__pyx_t_11 = NULL;
14232  int __pyx_lineno = 0;
14233  const char *__pyx_filename = NULL;
14234  int __pyx_clineno = 0;
14235  __Pyx_RefNannySetupContext("_unellipsify", 0);
14236  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
14237 
14238  /* "View.MemoryView":673
14239  * full slices.
14240  * """
14241  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14242  * tup = (index,)
14243  * else:
14244  */
14245  __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
14246  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14247  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14248  if (__pyx_t_2) {
14249 
14250  /* "View.MemoryView":674
14251  * """
14252  * if not isinstance(index, tuple):
14253  * tup = (index,) # <<<<<<<<<<<<<<
14254  * else:
14255  * tup = index
14256  */
14257  __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
14258  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
14259  __Pyx_GOTREF(__pyx_t_3);
14260  __Pyx_INCREF(__pyx_v_index);
14261  __Pyx_GIVEREF(__pyx_v_index);
14262  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14263  __pyx_v_tup = __pyx_t_3;
14264  __pyx_t_3 = 0;
14265 
14266  /* "View.MemoryView":673
14267  * full slices.
14268  * """
14269  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14270  * tup = (index,)
14271  * else:
14272  */
14273  goto __pyx_L3;
14274  }
14275 
14276  /* "View.MemoryView":676
14277  * tup = (index,)
14278  * else:
14279  * tup = index # <<<<<<<<<<<<<<
14280  *
14281  * result = []
14282  */
14283  __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
14284  /*else*/ {
14285  __Pyx_INCREF(__pyx_v_index);
14286  __pyx_v_tup = __pyx_v_index;
14287  }
14288  __pyx_L3:;
14289 
14290  /* "View.MemoryView":678
14291  * tup = index
14292  *
14293  * result = [] # <<<<<<<<<<<<<<
14294  * have_slices = False
14295  * seen_ellipsis = False
14296  */
14297  __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
14298  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
14299  __Pyx_GOTREF(__pyx_t_3);
14300  __pyx_v_result = ((PyObject*)__pyx_t_3);
14301  __pyx_t_3 = 0;
14302 
14303  /* "View.MemoryView":679
14304  *
14305  * result = []
14306  * have_slices = False # <<<<<<<<<<<<<<
14307  * seen_ellipsis = False
14308  * for idx, item in enumerate(tup):
14309  */
14310  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14311  __pyx_v_have_slices = 0;
14312 
14313  /* "View.MemoryView":680
14314  * result = []
14315  * have_slices = False
14316  * seen_ellipsis = False # <<<<<<<<<<<<<<
14317  * for idx, item in enumerate(tup):
14318  * if item is Ellipsis:
14319  */
14320  __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
14321  __pyx_v_seen_ellipsis = 0;
14322 
14323  /* "View.MemoryView":681
14324  * have_slices = False
14325  * seen_ellipsis = False
14326  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14327  * if item is Ellipsis:
14328  * if not seen_ellipsis:
14329  */
14330  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14331  __Pyx_INCREF(__pyx_int_0);
14332  __pyx_t_3 = __pyx_int_0;
14333  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14334  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14335  __pyx_t_6 = NULL;
14336  } else {
14337  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
14338  __Pyx_GOTREF(__pyx_t_4);
14339  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
14340  }
14341  for (;;) {
14342  if (likely(!__pyx_t_6)) {
14343  if (likely(PyList_CheckExact(__pyx_t_4))) {
14344  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14345  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14346  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14347  #else
14348  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14349  __Pyx_GOTREF(__pyx_t_7);
14350  #endif
14351  } else {
14352  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14353  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14354  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14355  #else
14356  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14357  __Pyx_GOTREF(__pyx_t_7);
14358  #endif
14359  }
14360  } else {
14361  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14362  if (unlikely(!__pyx_t_7)) {
14363  PyObject* exc_type = PyErr_Occurred();
14364  if (exc_type) {
14365  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14366  else __PYX_ERR(1, 681, __pyx_L1_error)
14367  }
14368  break;
14369  }
14370  __Pyx_GOTREF(__pyx_t_7);
14371  }
14372  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14373  __pyx_t_7 = 0;
14374  __Pyx_INCREF(__pyx_t_3);
14375  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14376  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14377  __Pyx_GOTREF(__pyx_t_7);
14378  __Pyx_DECREF(__pyx_t_3);
14379  __pyx_t_3 = __pyx_t_7;
14380  __pyx_t_7 = 0;
14381 
14382  /* "View.MemoryView":682
14383  * seen_ellipsis = False
14384  * for idx, item in enumerate(tup):
14385  * if item is Ellipsis: # <<<<<<<<<<<<<<
14386  * if not seen_ellipsis:
14387  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14388  */
14389  __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
14390  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14391  __pyx_t_1 = (__pyx_t_2 != 0);
14392  if (__pyx_t_1) {
14393 
14394  /* "View.MemoryView":683
14395  * for idx, item in enumerate(tup):
14396  * if item is Ellipsis:
14397  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14398  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14399  * seen_ellipsis = True
14400  */
14401  __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
14402  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14403  if (__pyx_t_1) {
14404 
14405  /* "View.MemoryView":684
14406  * if item is Ellipsis:
14407  * if not seen_ellipsis:
14408  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14409  * seen_ellipsis = True
14410  * else:
14411  */
14412  __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
14413  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14414  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
14415  __Pyx_GOTREF(__pyx_t_7);
14416  { Py_ssize_t __pyx_temp;
14417  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14418  __Pyx_INCREF(__pyx_slice__32);
14419  __Pyx_GIVEREF(__pyx_slice__32);
14420  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
14421  }
14422  }
14423  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14424  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14425 
14426  /* "View.MemoryView":685
14427  * if not seen_ellipsis:
14428  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14429  * seen_ellipsis = True # <<<<<<<<<<<<<<
14430  * else:
14431  * result.append(slice(None))
14432  */
14433  __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
14434  __pyx_v_seen_ellipsis = 1;
14435 
14436  /* "View.MemoryView":683
14437  * for idx, item in enumerate(tup):
14438  * if item is Ellipsis:
14439  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14440  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14441  * seen_ellipsis = True
14442  */
14443  goto __pyx_L7;
14444  }
14445 
14446  /* "View.MemoryView":687
14447  * seen_ellipsis = True
14448  * else:
14449  * result.append(slice(None)) # <<<<<<<<<<<<<<
14450  * have_slices = True
14451  * else:
14452  */
14453  __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
14454  /*else*/ {
14455  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
14456  }
14457  __pyx_L7:;
14458 
14459  /* "View.MemoryView":688
14460  * else:
14461  * result.append(slice(None))
14462  * have_slices = True # <<<<<<<<<<<<<<
14463  * else:
14464  * if not isinstance(item, slice) and not PyIndex_Check(item):
14465  */
14466  __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
14467  __pyx_v_have_slices = 1;
14468 
14469  /* "View.MemoryView":682
14470  * seen_ellipsis = False
14471  * for idx, item in enumerate(tup):
14472  * if item is Ellipsis: # <<<<<<<<<<<<<<
14473  * if not seen_ellipsis:
14474  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14475  */
14476  goto __pyx_L6;
14477  }
14478 
14479  /* "View.MemoryView":690
14480  * have_slices = True
14481  * else:
14482  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14483  * raise TypeError("Cannot index with type '%s'" % type(item))
14484  *
14485  */
14486  __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
14487  /*else*/ {
14488  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14489  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14490  if (__pyx_t_10) {
14491  } else {
14492  __pyx_t_1 = __pyx_t_10;
14493  goto __pyx_L9_bool_binop_done;
14494  }
14495  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14496  __pyx_t_1 = __pyx_t_10;
14497  __pyx_L9_bool_binop_done:;
14498  if (unlikely(__pyx_t_1)) {
14499 
14500  /* "View.MemoryView":691
14501  * else:
14502  * if not isinstance(item, slice) and not PyIndex_Check(item):
14503  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14504  *
14505  * have_slices = have_slices or isinstance(item, slice)
14506  */
14507  __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
14508  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
14509  __Pyx_GOTREF(__pyx_t_7);
14510  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
14511  __Pyx_GOTREF(__pyx_t_11);
14512  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14513  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14514  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14515  __PYX_ERR(1, 691, __pyx_L1_error)
14516 
14517  /* "View.MemoryView":690
14518  * have_slices = True
14519  * else:
14520  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14521  * raise TypeError("Cannot index with type '%s'" % type(item))
14522  *
14523  */
14524  }
14525 
14526  /* "View.MemoryView":693
14527  * raise TypeError("Cannot index with type '%s'" % type(item))
14528  *
14529  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14530  * result.append(item)
14531  *
14532  */
14533  __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
14534  __pyx_t_10 = (__pyx_v_have_slices != 0);
14535  if (!__pyx_t_10) {
14536  } else {
14537  __pyx_t_1 = __pyx_t_10;
14538  goto __pyx_L11_bool_binop_done;
14539  }
14540  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14541  __pyx_t_2 = (__pyx_t_10 != 0);
14542  __pyx_t_1 = __pyx_t_2;
14543  __pyx_L11_bool_binop_done:;
14544  __pyx_v_have_slices = __pyx_t_1;
14545 
14546  /* "View.MemoryView":694
14547  *
14548  * have_slices = have_slices or isinstance(item, slice)
14549  * result.append(item) # <<<<<<<<<<<<<<
14550  *
14551  * nslices = ndim - len(result)
14552  */
14553  __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
14554  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14555  }
14556  __pyx_L6:;
14557 
14558  /* "View.MemoryView":681
14559  * have_slices = False
14560  * seen_ellipsis = False
14561  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14562  * if item is Ellipsis:
14563  * if not seen_ellipsis:
14564  */
14565  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14566  }
14567  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14568  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14569 
14570  /* "View.MemoryView":696
14571  * result.append(item)
14572  *
14573  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14574  * if nslices:
14575  * result.extend([slice(None)] * nslices)
14576  */
14577  __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
14578  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14579  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14580 
14581  /* "View.MemoryView":697
14582  *
14583  * nslices = ndim - len(result)
14584  * if nslices: # <<<<<<<<<<<<<<
14585  * result.extend([slice(None)] * nslices)
14586  *
14587  */
14588  __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
14589  __pyx_t_1 = (__pyx_v_nslices != 0);
14590  if (__pyx_t_1) {
14591 
14592  /* "View.MemoryView":698
14593  * nslices = ndim - len(result)
14594  * if nslices:
14595  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14596  *
14597  * return have_slices or nslices, tuple(result)
14598  */
14599  __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14600  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
14601  __Pyx_GOTREF(__pyx_t_3);
14602  { Py_ssize_t __pyx_temp;
14603  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14604  __Pyx_INCREF(__pyx_slice__32);
14605  __Pyx_GIVEREF(__pyx_slice__32);
14606  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14607  }
14608  }
14609  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
14610  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14611 
14612  /* "View.MemoryView":697
14613  *
14614  * nslices = ndim - len(result)
14615  * if nslices: # <<<<<<<<<<<<<<
14616  * result.extend([slice(None)] * nslices)
14617  *
14618  */
14619  }
14620 
14621  /* "View.MemoryView":700
14622  * result.extend([slice(None)] * nslices)
14623  *
14624  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14625  *
14626  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14627  */
14628  __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
14629  __Pyx_XDECREF(__pyx_r);
14630  if (!__pyx_v_have_slices) {
14631  } else {
14632  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14633  __Pyx_GOTREF(__pyx_t_4);
14634  __pyx_t_3 = __pyx_t_4;
14635  __pyx_t_4 = 0;
14636  goto __pyx_L14_bool_binop_done;
14637  }
14638  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14639  __Pyx_GOTREF(__pyx_t_4);
14640  __pyx_t_3 = __pyx_t_4;
14641  __pyx_t_4 = 0;
14642  __pyx_L14_bool_binop_done:;
14643  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14644  __Pyx_GOTREF(__pyx_t_4);
14645  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
14646  __Pyx_GOTREF(__pyx_t_11);
14647  __Pyx_GIVEREF(__pyx_t_3);
14648  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14649  __Pyx_GIVEREF(__pyx_t_4);
14650  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14651  __pyx_t_3 = 0;
14652  __pyx_t_4 = 0;
14653  __pyx_r = ((PyObject*)__pyx_t_11);
14654  __pyx_t_11 = 0;
14655  goto __pyx_L0;
14656 
14657  /* "View.MemoryView":668
14658  * return isinstance(o, memoryview)
14659  *
14660  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14661  * """
14662  * Replace all ellipses with full slices and fill incomplete indices with
14663  */
14664 
14665  /* function exit code */
14666  __pyx_L1_error:;
14667  __Pyx_XDECREF(__pyx_t_3);
14668  __Pyx_XDECREF(__pyx_t_4);
14669  __Pyx_XDECREF(__pyx_t_7);
14670  __Pyx_XDECREF(__pyx_t_11);
14671  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14672  __pyx_r = 0;
14673  __pyx_L0:;
14674  __Pyx_XDECREF(__pyx_v_tup);
14675  __Pyx_XDECREF(__pyx_v_result);
14676  __Pyx_XDECREF(__pyx_v_idx);
14677  __Pyx_XDECREF(__pyx_v_item);
14678  __Pyx_XGIVEREF(__pyx_r);
14679  __Pyx_TraceReturn(__pyx_r, 0);
14680  __Pyx_RefNannyFinishContext();
14681  return __pyx_r;
14682 }
14683 
14684 /* "View.MemoryView":702
14685  * return have_slices or nslices, tuple(result)
14686  *
14687  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14688  * for suboffset in suboffsets[:ndim]:
14689  * if suboffset >= 0:
14690  */
14691 
14692 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14693  Py_ssize_t __pyx_v_suboffset;
14694  PyObject *__pyx_r = NULL;
14695  __Pyx_TraceDeclarations
14696  __Pyx_RefNannyDeclarations
14697  Py_ssize_t *__pyx_t_1;
14698  Py_ssize_t *__pyx_t_2;
14699  Py_ssize_t *__pyx_t_3;
14700  int __pyx_t_4;
14701  PyObject *__pyx_t_5 = NULL;
14702  int __pyx_lineno = 0;
14703  const char *__pyx_filename = NULL;
14704  int __pyx_clineno = 0;
14705  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14706  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
14707 
14708  /* "View.MemoryView":703
14709  *
14710  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14711  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14712  * if suboffset >= 0:
14713  * raise ValueError("Indirect dimensions not supported")
14714  */
14715  __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14716  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14717  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14718  __pyx_t_1 = __pyx_t_3;
14719  __pyx_v_suboffset = (__pyx_t_1[0]);
14720 
14721  /* "View.MemoryView":704
14722  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14723  * for suboffset in suboffsets[:ndim]:
14724  * if suboffset >= 0: # <<<<<<<<<<<<<<
14725  * raise ValueError("Indirect dimensions not supported")
14726  *
14727  */
14728  __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
14729  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14730  if (unlikely(__pyx_t_4)) {
14731 
14732  /* "View.MemoryView":705
14733  * for suboffset in suboffsets[:ndim]:
14734  * if suboffset >= 0:
14735  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14736  *
14737  *
14738  */
14739  __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
14740  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
14741  __Pyx_GOTREF(__pyx_t_5);
14742  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14743  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14744  __PYX_ERR(1, 705, __pyx_L1_error)
14745 
14746  /* "View.MemoryView":704
14747  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14748  * for suboffset in suboffsets[:ndim]:
14749  * if suboffset >= 0: # <<<<<<<<<<<<<<
14750  * raise ValueError("Indirect dimensions not supported")
14751  *
14752  */
14753  }
14754  }
14755 
14756  /* "View.MemoryView":702
14757  * return have_slices or nslices, tuple(result)
14758  *
14759  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14760  * for suboffset in suboffsets[:ndim]:
14761  * if suboffset >= 0:
14762  */
14763 
14764  /* function exit code */
14765  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14766  goto __pyx_L0;
14767  __pyx_L1_error:;
14768  __Pyx_XDECREF(__pyx_t_5);
14769  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14770  __pyx_r = 0;
14771  __pyx_L0:;
14772  __Pyx_XGIVEREF(__pyx_r);
14773  __Pyx_TraceReturn(__pyx_r, 0);
14774  __Pyx_RefNannyFinishContext();
14775  return __pyx_r;
14776 }
14777 
14778 /* "View.MemoryView":712
14779  *
14780  * @cname('__pyx_memview_slice')
14781  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14782  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14783  * cdef bint negative_step
14784  */
14785 
14786 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14787  int __pyx_v_new_ndim;
14788  int __pyx_v_suboffset_dim;
14789  int __pyx_v_dim;
14790  __Pyx_memviewslice __pyx_v_src;
14791  __Pyx_memviewslice __pyx_v_dst;
14792  __Pyx_memviewslice *__pyx_v_p_src;
14793  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14794  __Pyx_memviewslice *__pyx_v_p_dst;
14795  int *__pyx_v_p_suboffset_dim;
14796  Py_ssize_t __pyx_v_start;
14797  Py_ssize_t __pyx_v_stop;
14798  Py_ssize_t __pyx_v_step;
14799  int __pyx_v_have_start;
14800  int __pyx_v_have_stop;
14801  int __pyx_v_have_step;
14802  PyObject *__pyx_v_index = NULL;
14803  struct __pyx_memoryview_obj *__pyx_r = NULL;
14804  __Pyx_TraceDeclarations
14805  __Pyx_RefNannyDeclarations
14806  int __pyx_t_1;
14807  int __pyx_t_2;
14808  PyObject *__pyx_t_3 = NULL;
14809  struct __pyx_memoryview_obj *__pyx_t_4;
14810  char *__pyx_t_5;
14811  int __pyx_t_6;
14812  Py_ssize_t __pyx_t_7;
14813  PyObject *(*__pyx_t_8)(PyObject *);
14814  PyObject *__pyx_t_9 = NULL;
14815  Py_ssize_t __pyx_t_10;
14816  int __pyx_t_11;
14817  Py_ssize_t __pyx_t_12;
14818  int __pyx_lineno = 0;
14819  const char *__pyx_filename = NULL;
14820  int __pyx_clineno = 0;
14821  __Pyx_RefNannySetupContext("memview_slice", 0);
14822  __Pyx_TraceCall("memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
14823 
14824  /* "View.MemoryView":713
14825  * @cname('__pyx_memview_slice')
14826  * cdef memoryview memview_slice(memoryview memview, object indices):
14827  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14828  * cdef bint negative_step
14829  * cdef __Pyx_memviewslice src, dst
14830  */
14831  __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
14832  __pyx_v_new_ndim = 0;
14833  __pyx_v_suboffset_dim = -1;
14834 
14835  /* "View.MemoryView":720
14836  *
14837  *
14838  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14839  *
14840  * cdef _memoryviewslice memviewsliceobj
14841  */
14842  __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
14843  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14844 
14845  /* "View.MemoryView":724
14846  * cdef _memoryviewslice memviewsliceobj
14847  *
14848  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14849  *
14850  * if isinstance(memview, _memoryviewslice):
14851  */
14852  __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14853  #ifndef CYTHON_WITHOUT_ASSERTIONS
14854  if (unlikely(__pyx_assertions_enabled())) {
14855  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14856  PyErr_SetNone(PyExc_AssertionError);
14857  __PYX_ERR(1, 724, __pyx_L1_error)
14858  }
14859  }
14860  #endif
14861 
14862  /* "View.MemoryView":726
14863  * assert memview.view.ndim > 0
14864  *
14865  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14866  * memviewsliceobj = memview
14867  * p_src = &memviewsliceobj.from_slice
14868  */
14869  __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14870  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14871  __pyx_t_2 = (__pyx_t_1 != 0);
14872  if (__pyx_t_2) {
14873 
14874  /* "View.MemoryView":727
14875  *
14876  * if isinstance(memview, _memoryviewslice):
14877  * memviewsliceobj = memview # <<<<<<<<<<<<<<
14878  * p_src = &memviewsliceobj.from_slice
14879  * else:
14880  */
14881  __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
14882  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
14883  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14884  __Pyx_INCREF(__pyx_t_3);
14885  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14886  __pyx_t_3 = 0;
14887 
14888  /* "View.MemoryView":728
14889  * if isinstance(memview, _memoryviewslice):
14890  * memviewsliceobj = memview
14891  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14892  * else:
14893  * slice_copy(memview, &src)
14894  */
14895  __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14896  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14897 
14898  /* "View.MemoryView":726
14899  * assert memview.view.ndim > 0
14900  *
14901  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14902  * memviewsliceobj = memview
14903  * p_src = &memviewsliceobj.from_slice
14904  */
14905  goto __pyx_L3;
14906  }
14907 
14908  /* "View.MemoryView":730
14909  * p_src = &memviewsliceobj.from_slice
14910  * else:
14911  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14912  * p_src = &src
14913  *
14914  */
14915  __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
14916  /*else*/ {
14917  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14918 
14919  /* "View.MemoryView":731
14920  * else:
14921  * slice_copy(memview, &src)
14922  * p_src = &src # <<<<<<<<<<<<<<
14923  *
14924  *
14925  */
14926  __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
14927  __pyx_v_p_src = (&__pyx_v_src);
14928  }
14929  __pyx_L3:;
14930 
14931  /* "View.MemoryView":737
14932  *
14933  *
14934  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14935  * dst.data = p_src.data
14936  *
14937  */
14938  __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
14939  __pyx_t_4 = __pyx_v_p_src->memview;
14940  __pyx_v_dst.memview = __pyx_t_4;
14941 
14942  /* "View.MemoryView":738
14943  *
14944  * dst.memview = p_src.memview
14945  * dst.data = p_src.data # <<<<<<<<<<<<<<
14946  *
14947  *
14948  */
14949  __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
14950  __pyx_t_5 = __pyx_v_p_src->data;
14951  __pyx_v_dst.data = __pyx_t_5;
14952 
14953  /* "View.MemoryView":743
14954  *
14955  *
14956  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14957  * cdef int *p_suboffset_dim = &suboffset_dim
14958  * cdef Py_ssize_t start, stop, step
14959  */
14960  __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
14961  __pyx_v_p_dst = (&__pyx_v_dst);
14962 
14963  /* "View.MemoryView":744
14964  *
14965  * cdef __Pyx_memviewslice *p_dst = &dst
14966  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14967  * cdef Py_ssize_t start, stop, step
14968  * cdef bint have_start, have_stop, have_step
14969  */
14970  __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
14971  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14972 
14973  /* "View.MemoryView":748
14974  * cdef bint have_start, have_stop, have_step
14975  *
14976  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14977  * if PyIndex_Check(index):
14978  * slice_memviewslice(
14979  */
14980  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14981  __pyx_t_6 = 0;
14982  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14983  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14984  __pyx_t_8 = NULL;
14985  } else {
14986  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
14987  __Pyx_GOTREF(__pyx_t_3);
14988  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
14989  }
14990  for (;;) {
14991  if (likely(!__pyx_t_8)) {
14992  if (likely(PyList_CheckExact(__pyx_t_3))) {
14993  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
14994  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14995  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
14996  #else
14997  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
14998  __Pyx_GOTREF(__pyx_t_9);
14999  #endif
15000  } else {
15001  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15002  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15003  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
15004  #else
15005  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
15006  __Pyx_GOTREF(__pyx_t_9);
15007  #endif
15008  }
15009  } else {
15010  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15011  if (unlikely(!__pyx_t_9)) {
15012  PyObject* exc_type = PyErr_Occurred();
15013  if (exc_type) {
15014  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15015  else __PYX_ERR(1, 748, __pyx_L1_error)
15016  }
15017  break;
15018  }
15019  __Pyx_GOTREF(__pyx_t_9);
15020  }
15021  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15022  __pyx_t_9 = 0;
15023  __pyx_v_dim = __pyx_t_6;
15024  __pyx_t_6 = (__pyx_t_6 + 1);
15025 
15026  /* "View.MemoryView":749
15027  *
15028  * for dim, index in enumerate(indices):
15029  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15030  * slice_memviewslice(
15031  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15032  */
15033  __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
15034  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15035  if (__pyx_t_2) {
15036 
15037  /* "View.MemoryView":753
15038  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15039  * dim, new_ndim, p_suboffset_dim,
15040  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15041  * 0, 0, 0, # have_{start,stop,step}
15042  * False)
15043  */
15044  __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
15045  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
15046 
15047  /* "View.MemoryView":750
15048  * for dim, index in enumerate(indices):
15049  * if PyIndex_Check(index):
15050  * slice_memviewslice( # <<<<<<<<<<<<<<
15051  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15052  * dim, new_ndim, p_suboffset_dim,
15053  */
15054  __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
15055  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
15056 
15057  /* "View.MemoryView":749
15058  *
15059  * for dim, index in enumerate(indices):
15060  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15061  * slice_memviewslice(
15062  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15063  */
15064  goto __pyx_L6;
15065  }
15066 
15067  /* "View.MemoryView":756
15068  * 0, 0, 0, # have_{start,stop,step}
15069  * False)
15070  * elif index is None: # <<<<<<<<<<<<<<
15071  * p_dst.shape[new_ndim] = 1
15072  * p_dst.strides[new_ndim] = 0
15073  */
15074  __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
15075  __pyx_t_2 = (__pyx_v_index == Py_None);
15076  __pyx_t_1 = (__pyx_t_2 != 0);
15077  if (__pyx_t_1) {
15078 
15079  /* "View.MemoryView":757
15080  * False)
15081  * elif index is None:
15082  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15083  * p_dst.strides[new_ndim] = 0
15084  * p_dst.suboffsets[new_ndim] = -1
15085  */
15086  __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
15087  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15088 
15089  /* "View.MemoryView":758
15090  * elif index is None:
15091  * p_dst.shape[new_ndim] = 1
15092  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15093  * p_dst.suboffsets[new_ndim] = -1
15094  * new_ndim += 1
15095  */
15096  __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
15097  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15098 
15099  /* "View.MemoryView":759
15100  * p_dst.shape[new_ndim] = 1
15101  * p_dst.strides[new_ndim] = 0
15102  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15103  * new_ndim += 1
15104  * else:
15105  */
15106  __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
15107  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15108 
15109  /* "View.MemoryView":760
15110  * p_dst.strides[new_ndim] = 0
15111  * p_dst.suboffsets[new_ndim] = -1
15112  * new_ndim += 1 # <<<<<<<<<<<<<<
15113  * else:
15114  * start = index.start or 0
15115  */
15116  __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
15117  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15118 
15119  /* "View.MemoryView":756
15120  * 0, 0, 0, # have_{start,stop,step}
15121  * False)
15122  * elif index is None: # <<<<<<<<<<<<<<
15123  * p_dst.shape[new_ndim] = 1
15124  * p_dst.strides[new_ndim] = 0
15125  */
15126  goto __pyx_L6;
15127  }
15128 
15129  /* "View.MemoryView":762
15130  * new_ndim += 1
15131  * else:
15132  * start = index.start or 0 # <<<<<<<<<<<<<<
15133  * stop = index.stop or 0
15134  * step = index.step or 0
15135  */
15136  __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
15137  /*else*/ {
15138  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15139  __Pyx_GOTREF(__pyx_t_9);
15140  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15141  if (!__pyx_t_1) {
15142  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15143  } else {
15144  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15145  __pyx_t_10 = __pyx_t_12;
15146  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15147  goto __pyx_L7_bool_binop_done;
15148  }
15149  __pyx_t_10 = 0;
15150  __pyx_L7_bool_binop_done:;
15151  __pyx_v_start = __pyx_t_10;
15152 
15153  /* "View.MemoryView":763
15154  * else:
15155  * start = index.start or 0
15156  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15157  * step = index.step or 0
15158  *
15159  */
15160  __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
15161  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
15162  __Pyx_GOTREF(__pyx_t_9);
15163  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
15164  if (!__pyx_t_1) {
15165  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15166  } else {
15167  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
15168  __pyx_t_10 = __pyx_t_12;
15169  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15170  goto __pyx_L9_bool_binop_done;
15171  }
15172  __pyx_t_10 = 0;
15173  __pyx_L9_bool_binop_done:;
15174  __pyx_v_stop = __pyx_t_10;
15175 
15176  /* "View.MemoryView":764
15177  * start = index.start or 0
15178  * stop = index.stop or 0
15179  * step = index.step or 0 # <<<<<<<<<<<<<<
15180  *
15181  * have_start = index.start is not None
15182  */
15183  __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
15184  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15185  __Pyx_GOTREF(__pyx_t_9);
15186  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
15187  if (!__pyx_t_1) {
15188  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15189  } else {
15190  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
15191  __pyx_t_10 = __pyx_t_12;
15192  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15193  goto __pyx_L11_bool_binop_done;
15194  }
15195  __pyx_t_10 = 0;
15196  __pyx_L11_bool_binop_done:;
15197  __pyx_v_step = __pyx_t_10;
15198 
15199  /* "View.MemoryView":766
15200  * step = index.step or 0
15201  *
15202  * have_start = index.start is not None # <<<<<<<<<<<<<<
15203  * have_stop = index.stop is not None
15204  * have_step = index.step is not None
15205  */
15206  __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
15207  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15208  __Pyx_GOTREF(__pyx_t_9);
15209  __pyx_t_1 = (__pyx_t_9 != Py_None);
15210  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15211  __pyx_v_have_start = __pyx_t_1;
15212 
15213  /* "View.MemoryView":767
15214  *
15215  * have_start = index.start is not None
15216  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15217  * have_step = index.step is not None
15218  *
15219  */
15220  __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
15221  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
15222  __Pyx_GOTREF(__pyx_t_9);
15223  __pyx_t_1 = (__pyx_t_9 != Py_None);
15224  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15225  __pyx_v_have_stop = __pyx_t_1;
15226 
15227  /* "View.MemoryView":768
15228  * have_start = index.start is not None
15229  * have_stop = index.stop is not None
15230  * have_step = index.step is not None # <<<<<<<<<<<<<<
15231  *
15232  * slice_memviewslice(
15233  */
15234  __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
15235  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
15236  __Pyx_GOTREF(__pyx_t_9);
15237  __pyx_t_1 = (__pyx_t_9 != Py_None);
15238  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15239  __pyx_v_have_step = __pyx_t_1;
15240 
15241  /* "View.MemoryView":770
15242  * have_step = index.step is not None
15243  *
15244  * slice_memviewslice( # <<<<<<<<<<<<<<
15245  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15246  * dim, new_ndim, p_suboffset_dim,
15247  */
15248  __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
15249  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
15250 
15251  /* "View.MemoryView":776
15252  * have_start, have_stop, have_step,
15253  * True)
15254  * new_ndim += 1 # <<<<<<<<<<<<<<
15255  *
15256  * if isinstance(memview, _memoryviewslice):
15257  */
15258  __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
15259  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15260  }
15261  __pyx_L6:;
15262 
15263  /* "View.MemoryView":748
15264  * cdef bint have_start, have_stop, have_step
15265  *
15266  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15267  * if PyIndex_Check(index):
15268  * slice_memviewslice(
15269  */
15270  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
15271  }
15272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15273 
15274  /* "View.MemoryView":778
15275  * new_ndim += 1
15276  *
15277  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15278  * return memoryview_fromslice(dst, new_ndim,
15279  * memviewsliceobj.to_object_func,
15280  */
15281  __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
15282  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15283  __pyx_t_2 = (__pyx_t_1 != 0);
15284  if (__pyx_t_2) {
15285 
15286  /* "View.MemoryView":779
15287  *
15288  * if isinstance(memview, _memoryviewslice):
15289  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15290  * memviewsliceobj.to_object_func,
15291  * memviewsliceobj.to_dtype_func,
15292  */
15293  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15294  __Pyx_XDECREF(((PyObject *)__pyx_r));
15295 
15296  /* "View.MemoryView":780
15297  * if isinstance(memview, _memoryviewslice):
15298  * return memoryview_fromslice(dst, new_ndim,
15299  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15300  * memviewsliceobj.to_dtype_func,
15301  * memview.dtype_is_object)
15302  */
15303  __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
15304  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
15305 
15306  /* "View.MemoryView":781
15307  * return memoryview_fromslice(dst, new_ndim,
15308  * memviewsliceobj.to_object_func,
15309  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15310  * memview.dtype_is_object)
15311  * else:
15312  */
15313  __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
15314  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
15315 
15316  /* "View.MemoryView":779
15317  *
15318  * if isinstance(memview, _memoryviewslice):
15319  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15320  * memviewsliceobj.to_object_func,
15321  * memviewsliceobj.to_dtype_func,
15322  */
15323  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15324  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
15325  __Pyx_GOTREF(__pyx_t_3);
15326  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
15327  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15328  __pyx_t_3 = 0;
15329  goto __pyx_L0;
15330 
15331  /* "View.MemoryView":778
15332  * new_ndim += 1
15333  *
15334  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15335  * return memoryview_fromslice(dst, new_ndim,
15336  * memviewsliceobj.to_object_func,
15337  */
15338  }
15339 
15340  /* "View.MemoryView":784
15341  * memview.dtype_is_object)
15342  * else:
15343  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15344  * memview.dtype_is_object)
15345  *
15346  */
15347  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15348  /*else*/ {
15349  __Pyx_XDECREF(((PyObject *)__pyx_r));
15350 
15351  /* "View.MemoryView":785
15352  * else:
15353  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15354  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15355  *
15356  *
15357  */
15358  __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
15359  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
15360  __Pyx_GOTREF(__pyx_t_3);
15361 
15362  /* "View.MemoryView":784
15363  * memview.dtype_is_object)
15364  * else:
15365  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15366  * memview.dtype_is_object)
15367  *
15368  */
15369  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15370  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
15371  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15372  __pyx_t_3 = 0;
15373  goto __pyx_L0;
15374  }
15375 
15376  /* "View.MemoryView":712
15377  *
15378  * @cname('__pyx_memview_slice')
15379  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15380  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15381  * cdef bint negative_step
15382  */
15383 
15384  /* function exit code */
15385  __pyx_L1_error:;
15386  __Pyx_XDECREF(__pyx_t_3);
15387  __Pyx_XDECREF(__pyx_t_9);
15388  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15389  __pyx_r = 0;
15390  __pyx_L0:;
15391  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15392  __Pyx_XDECREF(__pyx_v_index);
15393  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15394  __Pyx_TraceReturn(__pyx_r, 0);
15395  __Pyx_RefNannyFinishContext();
15396  return __pyx_r;
15397 }
15398 
15399 /* "View.MemoryView":809
15400  *
15401  * @cname('__pyx_memoryview_slice_memviewslice')
15402  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15403  * __Pyx_memviewslice *dst,
15404  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15405  */
15406 
15407 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15408  Py_ssize_t __pyx_v_new_shape;
15409  int __pyx_v_negative_step;
15410  int __pyx_r;
15411  __Pyx_TraceDeclarations
15412  int __pyx_t_1;
15413  int __pyx_t_2;
15414  int __pyx_t_3;
15415  int __pyx_lineno = 0;
15416  const char *__pyx_filename = NULL;
15417  int __pyx_clineno = 0;
15418  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
15419 
15420  /* "View.MemoryView":829
15421  * cdef bint negative_step
15422  *
15423  * if not is_slice: # <<<<<<<<<<<<<<
15424  *
15425  * if start < 0:
15426  */
15427  __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
15428  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15429  if (__pyx_t_1) {
15430 
15431  /* "View.MemoryView":831
15432  * if not is_slice:
15433  *
15434  * if start < 0: # <<<<<<<<<<<<<<
15435  * start += shape
15436  * if not 0 <= start < shape:
15437  */
15438  __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
15439  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15440  if (__pyx_t_1) {
15441 
15442  /* "View.MemoryView":832
15443  *
15444  * if start < 0:
15445  * start += shape # <<<<<<<<<<<<<<
15446  * if not 0 <= start < shape:
15447  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15448  */
15449  __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
15450  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15451 
15452  /* "View.MemoryView":831
15453  * if not is_slice:
15454  *
15455  * if start < 0: # <<<<<<<<<<<<<<
15456  * start += shape
15457  * if not 0 <= start < shape:
15458  */
15459  }
15460 
15461  /* "View.MemoryView":833
15462  * if start < 0:
15463  * start += shape
15464  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15465  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15466  * else:
15467  */
15468  __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
15469  __pyx_t_1 = (0 <= __pyx_v_start);
15470  if (__pyx_t_1) {
15471  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15472  }
15473  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15474  if (__pyx_t_2) {
15475 
15476  /* "View.MemoryView":834
15477  * start += shape
15478  * if not 0 <= start < shape:
15479  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15480  * else:
15481  *
15482  */
15483  __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
15484  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
15485 
15486  /* "View.MemoryView":833
15487  * if start < 0:
15488  * start += shape
15489  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15490  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15491  * else:
15492  */
15493  }
15494 
15495  /* "View.MemoryView":829
15496  * cdef bint negative_step
15497  *
15498  * if not is_slice: # <<<<<<<<<<<<<<
15499  *
15500  * if start < 0:
15501  */
15502  goto __pyx_L3;
15503  }
15504 
15505  /* "View.MemoryView":837
15506  * else:
15507  *
15508  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15509  *
15510  * if have_step and step == 0:
15511  */
15512  __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
15513  /*else*/ {
15514  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15515  if (__pyx_t_1) {
15516  } else {
15517  __pyx_t_2 = __pyx_t_1;
15518  goto __pyx_L6_bool_binop_done;
15519  }
15520  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15521  __pyx_t_2 = __pyx_t_1;
15522  __pyx_L6_bool_binop_done:;
15523  __pyx_v_negative_step = __pyx_t_2;
15524 
15525  /* "View.MemoryView":839
15526  * negative_step = have_step != 0 and step < 0
15527  *
15528  * if have_step and step == 0: # <<<<<<<<<<<<<<
15529  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15530  *
15531  */
15532  __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
15533  __pyx_t_1 = (__pyx_v_have_step != 0);
15534  if (__pyx_t_1) {
15535  } else {
15536  __pyx_t_2 = __pyx_t_1;
15537  goto __pyx_L9_bool_binop_done;
15538  }
15539  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15540  __pyx_t_2 = __pyx_t_1;
15541  __pyx_L9_bool_binop_done:;
15542  if (__pyx_t_2) {
15543 
15544  /* "View.MemoryView":840
15545  *
15546  * if have_step and step == 0:
15547  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15548  *
15549  *
15550  */
15551  __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
15552  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
15553 
15554  /* "View.MemoryView":839
15555  * negative_step = have_step != 0 and step < 0
15556  *
15557  * if have_step and step == 0: # <<<<<<<<<<<<<<
15558  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15559  *
15560  */
15561  }
15562 
15563  /* "View.MemoryView":843
15564  *
15565  *
15566  * if have_start: # <<<<<<<<<<<<<<
15567  * if start < 0:
15568  * start += shape
15569  */
15570  __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
15571  __pyx_t_2 = (__pyx_v_have_start != 0);
15572  if (__pyx_t_2) {
15573 
15574  /* "View.MemoryView":844
15575  *
15576  * if have_start:
15577  * if start < 0: # <<<<<<<<<<<<<<
15578  * start += shape
15579  * if start < 0:
15580  */
15581  __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
15582  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15583  if (__pyx_t_2) {
15584 
15585  /* "View.MemoryView":845
15586  * if have_start:
15587  * if start < 0:
15588  * start += shape # <<<<<<<<<<<<<<
15589  * if start < 0:
15590  * start = 0
15591  */
15592  __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
15593  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15594 
15595  /* "View.MemoryView":846
15596  * if start < 0:
15597  * start += shape
15598  * if start < 0: # <<<<<<<<<<<<<<
15599  * start = 0
15600  * elif start >= shape:
15601  */
15602  __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15603  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15604  if (__pyx_t_2) {
15605 
15606  /* "View.MemoryView":847
15607  * start += shape
15608  * if start < 0:
15609  * start = 0 # <<<<<<<<<<<<<<
15610  * elif start >= shape:
15611  * if negative_step:
15612  */
15613  __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15614  __pyx_v_start = 0;
15615 
15616  /* "View.MemoryView":846
15617  * if start < 0:
15618  * start += shape
15619  * if start < 0: # <<<<<<<<<<<<<<
15620  * start = 0
15621  * elif start >= shape:
15622  */
15623  }
15624 
15625  /* "View.MemoryView":844
15626  *
15627  * if have_start:
15628  * if start < 0: # <<<<<<<<<<<<<<
15629  * start += shape
15630  * if start < 0:
15631  */
15632  goto __pyx_L12;
15633  }
15634 
15635  /* "View.MemoryView":848
15636  * if start < 0:
15637  * start = 0
15638  * elif start >= shape: # <<<<<<<<<<<<<<
15639  * if negative_step:
15640  * start = shape - 1
15641  */
15642  __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15643  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15644  if (__pyx_t_2) {
15645 
15646  /* "View.MemoryView":849
15647  * start = 0
15648  * elif start >= shape:
15649  * if negative_step: # <<<<<<<<<<<<<<
15650  * start = shape - 1
15651  * else:
15652  */
15653  __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
15654  __pyx_t_2 = (__pyx_v_negative_step != 0);
15655  if (__pyx_t_2) {
15656 
15657  /* "View.MemoryView":850
15658  * elif start >= shape:
15659  * if negative_step:
15660  * start = shape - 1 # <<<<<<<<<<<<<<
15661  * else:
15662  * start = shape
15663  */
15664  __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15665  __pyx_v_start = (__pyx_v_shape - 1);
15666 
15667  /* "View.MemoryView":849
15668  * start = 0
15669  * elif start >= shape:
15670  * if negative_step: # <<<<<<<<<<<<<<
15671  * start = shape - 1
15672  * else:
15673  */
15674  goto __pyx_L14;
15675  }
15676 
15677  /* "View.MemoryView":852
15678  * start = shape - 1
15679  * else:
15680  * start = shape # <<<<<<<<<<<<<<
15681  * else:
15682  * if negative_step:
15683  */
15684  __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15685  /*else*/ {
15686  __pyx_v_start = __pyx_v_shape;
15687  }
15688  __pyx_L14:;
15689 
15690  /* "View.MemoryView":848
15691  * if start < 0:
15692  * start = 0
15693  * elif start >= shape: # <<<<<<<<<<<<<<
15694  * if negative_step:
15695  * start = shape - 1
15696  */
15697  }
15698  __pyx_L12:;
15699 
15700  /* "View.MemoryView":843
15701  *
15702  *
15703  * if have_start: # <<<<<<<<<<<<<<
15704  * if start < 0:
15705  * start += shape
15706  */
15707  goto __pyx_L11;
15708  }
15709 
15710  /* "View.MemoryView":854
15711  * start = shape
15712  * else:
15713  * if negative_step: # <<<<<<<<<<<<<<
15714  * start = shape - 1
15715  * else:
15716  */
15717  __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
15718  /*else*/ {
15719  __pyx_t_2 = (__pyx_v_negative_step != 0);
15720  if (__pyx_t_2) {
15721 
15722  /* "View.MemoryView":855
15723  * else:
15724  * if negative_step:
15725  * start = shape - 1 # <<<<<<<<<<<<<<
15726  * else:
15727  * start = 0
15728  */
15729  __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15730  __pyx_v_start = (__pyx_v_shape - 1);
15731 
15732  /* "View.MemoryView":854
15733  * start = shape
15734  * else:
15735  * if negative_step: # <<<<<<<<<<<<<<
15736  * start = shape - 1
15737  * else:
15738  */
15739  goto __pyx_L15;
15740  }
15741 
15742  /* "View.MemoryView":857
15743  * start = shape - 1
15744  * else:
15745  * start = 0 # <<<<<<<<<<<<<<
15746  *
15747  * if have_stop:
15748  */
15749  __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15750  /*else*/ {
15751  __pyx_v_start = 0;
15752  }
15753  __pyx_L15:;
15754  }
15755  __pyx_L11:;
15756 
15757  /* "View.MemoryView":859
15758  * start = 0
15759  *
15760  * if have_stop: # <<<<<<<<<<<<<<
15761  * if stop < 0:
15762  * stop += shape
15763  */
15764  __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15765  __pyx_t_2 = (__pyx_v_have_stop != 0);
15766  if (__pyx_t_2) {
15767 
15768  /* "View.MemoryView":860
15769  *
15770  * if have_stop:
15771  * if stop < 0: # <<<<<<<<<<<<<<
15772  * stop += shape
15773  * if stop < 0:
15774  */
15775  __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15776  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15777  if (__pyx_t_2) {
15778 
15779  /* "View.MemoryView":861
15780  * if have_stop:
15781  * if stop < 0:
15782  * stop += shape # <<<<<<<<<<<<<<
15783  * if stop < 0:
15784  * stop = 0
15785  */
15786  __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15787  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15788 
15789  /* "View.MemoryView":862
15790  * if stop < 0:
15791  * stop += shape
15792  * if stop < 0: # <<<<<<<<<<<<<<
15793  * stop = 0
15794  * elif stop > shape:
15795  */
15796  __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15797  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15798  if (__pyx_t_2) {
15799 
15800  /* "View.MemoryView":863
15801  * stop += shape
15802  * if stop < 0:
15803  * stop = 0 # <<<<<<<<<<<<<<
15804  * elif stop > shape:
15805  * stop = shape
15806  */
15807  __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15808  __pyx_v_stop = 0;
15809 
15810  /* "View.MemoryView":862
15811  * if stop < 0:
15812  * stop += shape
15813  * if stop < 0: # <<<<<<<<<<<<<<
15814  * stop = 0
15815  * elif stop > shape:
15816  */
15817  }
15818 
15819  /* "View.MemoryView":860
15820  *
15821  * if have_stop:
15822  * if stop < 0: # <<<<<<<<<<<<<<
15823  * stop += shape
15824  * if stop < 0:
15825  */
15826  goto __pyx_L17;
15827  }
15828 
15829  /* "View.MemoryView":864
15830  * if stop < 0:
15831  * stop = 0
15832  * elif stop > shape: # <<<<<<<<<<<<<<
15833  * stop = shape
15834  * else:
15835  */
15836  __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
15837  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15838  if (__pyx_t_2) {
15839 
15840  /* "View.MemoryView":865
15841  * stop = 0
15842  * elif stop > shape:
15843  * stop = shape # <<<<<<<<<<<<<<
15844  * else:
15845  * if negative_step:
15846  */
15847  __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15848  __pyx_v_stop = __pyx_v_shape;
15849 
15850  /* "View.MemoryView":864
15851  * if stop < 0:
15852  * stop = 0
15853  * elif stop > shape: # <<<<<<<<<<<<<<
15854  * stop = shape
15855  * else:
15856  */
15857  }
15858  __pyx_L17:;
15859 
15860  /* "View.MemoryView":859
15861  * start = 0
15862  *
15863  * if have_stop: # <<<<<<<<<<<<<<
15864  * if stop < 0:
15865  * stop += shape
15866  */
15867  goto __pyx_L16;
15868  }
15869 
15870  /* "View.MemoryView":867
15871  * stop = shape
15872  * else:
15873  * if negative_step: # <<<<<<<<<<<<<<
15874  * stop = -1
15875  * else:
15876  */
15877  __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
15878  /*else*/ {
15879  __pyx_t_2 = (__pyx_v_negative_step != 0);
15880  if (__pyx_t_2) {
15881 
15882  /* "View.MemoryView":868
15883  * else:
15884  * if negative_step:
15885  * stop = -1 # <<<<<<<<<<<<<<
15886  * else:
15887  * stop = shape
15888  */
15889  __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15890  __pyx_v_stop = -1L;
15891 
15892  /* "View.MemoryView":867
15893  * stop = shape
15894  * else:
15895  * if negative_step: # <<<<<<<<<<<<<<
15896  * stop = -1
15897  * else:
15898  */
15899  goto __pyx_L19;
15900  }
15901 
15902  /* "View.MemoryView":870
15903  * stop = -1
15904  * else:
15905  * stop = shape # <<<<<<<<<<<<<<
15906  *
15907  * if not have_step:
15908  */
15909  __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
15910  /*else*/ {
15911  __pyx_v_stop = __pyx_v_shape;
15912  }
15913  __pyx_L19:;
15914  }
15915  __pyx_L16:;
15916 
15917  /* "View.MemoryView":872
15918  * stop = shape
15919  *
15920  * if not have_step: # <<<<<<<<<<<<<<
15921  * step = 1
15922  *
15923  */
15924  __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
15925  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15926  if (__pyx_t_2) {
15927 
15928  /* "View.MemoryView":873
15929  *
15930  * if not have_step:
15931  * step = 1 # <<<<<<<<<<<<<<
15932  *
15933  *
15934  */
15935  __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
15936  __pyx_v_step = 1;
15937 
15938  /* "View.MemoryView":872
15939  * stop = shape
15940  *
15941  * if not have_step: # <<<<<<<<<<<<<<
15942  * step = 1
15943  *
15944  */
15945  }
15946 
15947  /* "View.MemoryView":877
15948  *
15949  * with cython.cdivision(True):
15950  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
15951  *
15952  * if (stop - start) - step * new_shape:
15953  */
15954  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15955 
15956  /* "View.MemoryView":879
15957  * new_shape = (stop - start) // step
15958  *
15959  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15960  * new_shape += 1
15961  *
15962  */
15963  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15964  if (__pyx_t_2) {
15965 
15966  /* "View.MemoryView":880
15967  *
15968  * if (stop - start) - step * new_shape:
15969  * new_shape += 1 # <<<<<<<<<<<<<<
15970  *
15971  * if new_shape < 0:
15972  */
15973  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15974 
15975  /* "View.MemoryView":879
15976  * new_shape = (stop - start) // step
15977  *
15978  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15979  * new_shape += 1
15980  *
15981  */
15982  }
15983 
15984  /* "View.MemoryView":882
15985  * new_shape += 1
15986  *
15987  * if new_shape < 0: # <<<<<<<<<<<<<<
15988  * new_shape = 0
15989  *
15990  */
15991  __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
15992  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15993  if (__pyx_t_2) {
15994 
15995  /* "View.MemoryView":883
15996  *
15997  * if new_shape < 0:
15998  * new_shape = 0 # <<<<<<<<<<<<<<
15999  *
16000  *
16001  */
16002  __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
16003  __pyx_v_new_shape = 0;
16004 
16005  /* "View.MemoryView":882
16006  * new_shape += 1
16007  *
16008  * if new_shape < 0: # <<<<<<<<<<<<<<
16009  * new_shape = 0
16010  *
16011  */
16012  }
16013 
16014  /* "View.MemoryView":886
16015  *
16016  *
16017  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16018  * dst.shape[new_ndim] = new_shape
16019  * dst.suboffsets[new_ndim] = suboffset
16020  */
16021  __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
16022  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16023 
16024  /* "View.MemoryView":887
16025  *
16026  * dst.strides[new_ndim] = stride * step
16027  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16028  * dst.suboffsets[new_ndim] = suboffset
16029  *
16030  */
16031  __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
16032  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16033 
16034  /* "View.MemoryView":888
16035  * dst.strides[new_ndim] = stride * step
16036  * dst.shape[new_ndim] = new_shape
16037  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16038  *
16039  *
16040  */
16041  __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
16042  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16043  }
16044  __pyx_L3:;
16045 
16046  /* "View.MemoryView":891
16047  *
16048  *
16049  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16050  * dst.data += start * stride
16051  * else:
16052  */
16053  __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
16054  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16055  if (__pyx_t_2) {
16056 
16057  /* "View.MemoryView":892
16058  *
16059  * if suboffset_dim[0] < 0:
16060  * dst.data += start * stride # <<<<<<<<<<<<<<
16061  * else:
16062  * dst.suboffsets[suboffset_dim[0]] += start * stride
16063  */
16064  __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
16065  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16066 
16067  /* "View.MemoryView":891
16068  *
16069  *
16070  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16071  * dst.data += start * stride
16072  * else:
16073  */
16074  goto __pyx_L23;
16075  }
16076 
16077  /* "View.MemoryView":894
16078  * dst.data += start * stride
16079  * else:
16080  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16081  *
16082  * if suboffset >= 0:
16083  */
16084  __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
16085  /*else*/ {
16086  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16087  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16088  }
16089  __pyx_L23:;
16090 
16091  /* "View.MemoryView":896
16092  * dst.suboffsets[suboffset_dim[0]] += start * stride
16093  *
16094  * if suboffset >= 0: # <<<<<<<<<<<<<<
16095  * if not is_slice:
16096  * if new_ndim == 0:
16097  */
16098  __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
16099  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16100  if (__pyx_t_2) {
16101 
16102  /* "View.MemoryView":897
16103  *
16104  * if suboffset >= 0:
16105  * if not is_slice: # <<<<<<<<<<<<<<
16106  * if new_ndim == 0:
16107  * dst.data = (<char **> dst.data)[0] + suboffset
16108  */
16109  __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
16110  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16111  if (__pyx_t_2) {
16112 
16113  /* "View.MemoryView":898
16114  * if suboffset >= 0:
16115  * if not is_slice:
16116  * if new_ndim == 0: # <<<<<<<<<<<<<<
16117  * dst.data = (<char **> dst.data)[0] + suboffset
16118  * else:
16119  */
16120  __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
16121  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16122  if (__pyx_t_2) {
16123 
16124  /* "View.MemoryView":899
16125  * if not is_slice:
16126  * if new_ndim == 0:
16127  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16128  * else:
16129  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16130  */
16131  __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
16132  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16133 
16134  /* "View.MemoryView":898
16135  * if suboffset >= 0:
16136  * if not is_slice:
16137  * if new_ndim == 0: # <<<<<<<<<<<<<<
16138  * dst.data = (<char **> dst.data)[0] + suboffset
16139  * else:
16140  */
16141  goto __pyx_L26;
16142  }
16143 
16144  /* "View.MemoryView":901
16145  * dst.data = (<char **> dst.data)[0] + suboffset
16146  * else:
16147  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16148  * "must be indexed and not sliced", dim)
16149  * else:
16150  */
16151  __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
16152  /*else*/ {
16153 
16154  /* "View.MemoryView":902
16155  * else:
16156  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16157  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16158  * else:
16159  * suboffset_dim[0] = new_ndim
16160  */
16161  __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
16162  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
16163  }
16164  __pyx_L26:;
16165 
16166  /* "View.MemoryView":897
16167  *
16168  * if suboffset >= 0:
16169  * if not is_slice: # <<<<<<<<<<<<<<
16170  * if new_ndim == 0:
16171  * dst.data = (<char **> dst.data)[0] + suboffset
16172  */
16173  goto __pyx_L25;
16174  }
16175 
16176  /* "View.MemoryView":904
16177  * "must be indexed and not sliced", dim)
16178  * else:
16179  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16180  *
16181  * return 0
16182  */
16183  __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
16184  /*else*/ {
16185  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16186  }
16187  __pyx_L25:;
16188 
16189  /* "View.MemoryView":896
16190  * dst.suboffsets[suboffset_dim[0]] += start * stride
16191  *
16192  * if suboffset >= 0: # <<<<<<<<<<<<<<
16193  * if not is_slice:
16194  * if new_ndim == 0:
16195  */
16196  }
16197 
16198  /* "View.MemoryView":906
16199  * suboffset_dim[0] = new_ndim
16200  *
16201  * return 0 # <<<<<<<<<<<<<<
16202  *
16203  *
16204  */
16205  __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
16206  __pyx_r = 0;
16207  goto __pyx_L0;
16208 
16209  /* "View.MemoryView":809
16210  *
16211  * @cname('__pyx_memoryview_slice_memviewslice')
16212  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16213  * __Pyx_memviewslice *dst,
16214  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16215  */
16216 
16217  /* function exit code */
16218  __pyx_L1_error:;
16219  {
16220  #ifdef WITH_THREAD
16221  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16222  #endif
16223  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16224  #ifdef WITH_THREAD
16225  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16226  #endif
16227  }
16228  __pyx_r = -1;
16229  __pyx_L0:;
16230  __Pyx_TraceReturn(Py_None, 1);
16231  return __pyx_r;
16232 }
16233 
16234 /* "View.MemoryView":912
16235  *
16236  * @cname('__pyx_pybuffer_index')
16237  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16238  * Py_ssize_t dim) except NULL:
16239  * cdef Py_ssize_t shape, stride, suboffset = -1
16240  */
16241 
16242 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16243  Py_ssize_t __pyx_v_shape;
16244  Py_ssize_t __pyx_v_stride;
16245  Py_ssize_t __pyx_v_suboffset;
16246  Py_ssize_t __pyx_v_itemsize;
16247  char *__pyx_v_resultp;
16248  char *__pyx_r;
16249  __Pyx_TraceDeclarations
16250  __Pyx_RefNannyDeclarations
16251  Py_ssize_t __pyx_t_1;
16252  int __pyx_t_2;
16253  PyObject *__pyx_t_3 = NULL;
16254  PyObject *__pyx_t_4 = NULL;
16255  int __pyx_lineno = 0;
16256  const char *__pyx_filename = NULL;
16257  int __pyx_clineno = 0;
16258  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16259  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
16260 
16261  /* "View.MemoryView":914
16262  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16263  * Py_ssize_t dim) except NULL:
16264  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16265  * cdef Py_ssize_t itemsize = view.itemsize
16266  * cdef char *resultp
16267  */
16268  __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
16269  __pyx_v_suboffset = -1L;
16270 
16271  /* "View.MemoryView":915
16272  * Py_ssize_t dim) except NULL:
16273  * cdef Py_ssize_t shape, stride, suboffset = -1
16274  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16275  * cdef char *resultp
16276  *
16277  */
16278  __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
16279  __pyx_t_1 = __pyx_v_view->itemsize;
16280  __pyx_v_itemsize = __pyx_t_1;
16281 
16282  /* "View.MemoryView":918
16283  * cdef char *resultp
16284  *
16285  * if view.ndim == 0: # <<<<<<<<<<<<<<
16286  * shape = view.len / itemsize
16287  * stride = itemsize
16288  */
16289  __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
16290  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16291  if (__pyx_t_2) {
16292 
16293  /* "View.MemoryView":919
16294  *
16295  * if view.ndim == 0:
16296  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16297  * stride = itemsize
16298  * else:
16299  */
16300  __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
16301  if (unlikely(__pyx_v_itemsize == 0)) {
16302  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16303  __PYX_ERR(1, 919, __pyx_L1_error)
16304  }
16305  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16306  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16307  __PYX_ERR(1, 919, __pyx_L1_error)
16308  }
16309  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
16310 
16311  /* "View.MemoryView":920
16312  * if view.ndim == 0:
16313  * shape = view.len / itemsize
16314  * stride = itemsize # <<<<<<<<<<<<<<
16315  * else:
16316  * shape = view.shape[dim]
16317  */
16318  __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
16319  __pyx_v_stride = __pyx_v_itemsize;
16320 
16321  /* "View.MemoryView":918
16322  * cdef char *resultp
16323  *
16324  * if view.ndim == 0: # <<<<<<<<<<<<<<
16325  * shape = view.len / itemsize
16326  * stride = itemsize
16327  */
16328  goto __pyx_L3;
16329  }
16330 
16331  /* "View.MemoryView":922
16332  * stride = itemsize
16333  * else:
16334  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16335  * stride = view.strides[dim]
16336  * if view.suboffsets != NULL:
16337  */
16338  __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
16339  /*else*/ {
16340  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16341 
16342  /* "View.MemoryView":923
16343  * else:
16344  * shape = view.shape[dim]
16345  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16346  * if view.suboffsets != NULL:
16347  * suboffset = view.suboffsets[dim]
16348  */
16349  __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
16350  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16351 
16352  /* "View.MemoryView":924
16353  * shape = view.shape[dim]
16354  * stride = view.strides[dim]
16355  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16356  * suboffset = view.suboffsets[dim]
16357  *
16358  */
16359  __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
16360  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16361  if (__pyx_t_2) {
16362 
16363  /* "View.MemoryView":925
16364  * stride = view.strides[dim]
16365  * if view.suboffsets != NULL:
16366  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16367  *
16368  * if index < 0:
16369  */
16370  __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
16371  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16372 
16373  /* "View.MemoryView":924
16374  * shape = view.shape[dim]
16375  * stride = view.strides[dim]
16376  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16377  * suboffset = view.suboffsets[dim]
16378  *
16379  */
16380  }
16381  }
16382  __pyx_L3:;
16383 
16384  /* "View.MemoryView":927
16385  * suboffset = view.suboffsets[dim]
16386  *
16387  * if index < 0: # <<<<<<<<<<<<<<
16388  * index += view.shape[dim]
16389  * if index < 0:
16390  */
16391  __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
16392  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16393  if (__pyx_t_2) {
16394 
16395  /* "View.MemoryView":928
16396  *
16397  * if index < 0:
16398  * index += view.shape[dim] # <<<<<<<<<<<<<<
16399  * if index < 0:
16400  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16401  */
16402  __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
16403  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16404 
16405  /* "View.MemoryView":929
16406  * if index < 0:
16407  * index += view.shape[dim]
16408  * if index < 0: # <<<<<<<<<<<<<<
16409  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16410  *
16411  */
16412  __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
16413  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16414  if (unlikely(__pyx_t_2)) {
16415 
16416  /* "View.MemoryView":930
16417  * index += view.shape[dim]
16418  * if index < 0:
16419  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16420  *
16421  * if index >= shape:
16422  */
16423  __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
16424  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16425  __Pyx_GOTREF(__pyx_t_3);
16426  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
16427  __Pyx_GOTREF(__pyx_t_4);
16428  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16429  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16430  __Pyx_GOTREF(__pyx_t_3);
16431  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16432  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16433  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16434  __PYX_ERR(1, 930, __pyx_L1_error)
16435 
16436  /* "View.MemoryView":929
16437  * if index < 0:
16438  * index += view.shape[dim]
16439  * if index < 0: # <<<<<<<<<<<<<<
16440  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16441  *
16442  */
16443  }
16444 
16445  /* "View.MemoryView":927
16446  * suboffset = view.suboffsets[dim]
16447  *
16448  * if index < 0: # <<<<<<<<<<<<<<
16449  * index += view.shape[dim]
16450  * if index < 0:
16451  */
16452  }
16453 
16454  /* "View.MemoryView":932
16455  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16456  *
16457  * if index >= shape: # <<<<<<<<<<<<<<
16458  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16459  *
16460  */
16461  __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
16462  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16463  if (unlikely(__pyx_t_2)) {
16464 
16465  /* "View.MemoryView":933
16466  *
16467  * if index >= shape:
16468  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16469  *
16470  * resultp = bufp + index * stride
16471  */
16472  __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
16473  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16474  __Pyx_GOTREF(__pyx_t_3);
16475  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
16476  __Pyx_GOTREF(__pyx_t_4);
16477  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16478  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16479  __Pyx_GOTREF(__pyx_t_3);
16480  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16481  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16482  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16483  __PYX_ERR(1, 933, __pyx_L1_error)
16484 
16485  /* "View.MemoryView":932
16486  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16487  *
16488  * if index >= shape: # <<<<<<<<<<<<<<
16489  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16490  *
16491  */
16492  }
16493 
16494  /* "View.MemoryView":935
16495  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16496  *
16497  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16498  * if suboffset >= 0:
16499  * resultp = (<char **> resultp)[0] + suboffset
16500  */
16501  __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
16502  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16503 
16504  /* "View.MemoryView":936
16505  *
16506  * resultp = bufp + index * stride
16507  * if suboffset >= 0: # <<<<<<<<<<<<<<
16508  * resultp = (<char **> resultp)[0] + suboffset
16509  *
16510  */
16511  __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
16512  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16513  if (__pyx_t_2) {
16514 
16515  /* "View.MemoryView":937
16516  * resultp = bufp + index * stride
16517  * if suboffset >= 0:
16518  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16519  *
16520  * return resultp
16521  */
16522  __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
16523  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16524 
16525  /* "View.MemoryView":936
16526  *
16527  * resultp = bufp + index * stride
16528  * if suboffset >= 0: # <<<<<<<<<<<<<<
16529  * resultp = (<char **> resultp)[0] + suboffset
16530  *
16531  */
16532  }
16533 
16534  /* "View.MemoryView":939
16535  * resultp = (<char **> resultp)[0] + suboffset
16536  *
16537  * return resultp # <<<<<<<<<<<<<<
16538  *
16539  *
16540  */
16541  __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
16542  __pyx_r = __pyx_v_resultp;
16543  goto __pyx_L0;
16544 
16545  /* "View.MemoryView":912
16546  *
16547  * @cname('__pyx_pybuffer_index')
16548  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16549  * Py_ssize_t dim) except NULL:
16550  * cdef Py_ssize_t shape, stride, suboffset = -1
16551  */
16552 
16553  /* function exit code */
16554  __pyx_L1_error:;
16555  __Pyx_XDECREF(__pyx_t_3);
16556  __Pyx_XDECREF(__pyx_t_4);
16557  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16558  __pyx_r = NULL;
16559  __pyx_L0:;
16560  __Pyx_TraceReturn(Py_None, 0);
16561  __Pyx_RefNannyFinishContext();
16562  return __pyx_r;
16563 }
16564 
16565 /* "View.MemoryView":945
16566  *
16567  * @cname('__pyx_memslice_transpose')
16568  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16569  * cdef int ndim = memslice.memview.view.ndim
16570  *
16571  */
16572 
16573 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16574  int __pyx_v_ndim;
16575  Py_ssize_t *__pyx_v_shape;
16576  Py_ssize_t *__pyx_v_strides;
16577  int __pyx_v_i;
16578  int __pyx_v_j;
16579  int __pyx_r;
16580  __Pyx_TraceDeclarations
16581  int __pyx_t_1;
16582  Py_ssize_t *__pyx_t_2;
16583  long __pyx_t_3;
16584  long __pyx_t_4;
16585  Py_ssize_t __pyx_t_5;
16586  Py_ssize_t __pyx_t_6;
16587  int __pyx_t_7;
16588  int __pyx_t_8;
16589  int __pyx_t_9;
16590  int __pyx_lineno = 0;
16591  const char *__pyx_filename = NULL;
16592  int __pyx_clineno = 0;
16593  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
16594 
16595  /* "View.MemoryView":946
16596  * @cname('__pyx_memslice_transpose')
16597  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16598  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16599  *
16600  * cdef Py_ssize_t *shape = memslice.shape
16601  */
16602  __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16603  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16604  __pyx_v_ndim = __pyx_t_1;
16605 
16606  /* "View.MemoryView":948
16607  * cdef int ndim = memslice.memview.view.ndim
16608  *
16609  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16610  * cdef Py_ssize_t *strides = memslice.strides
16611  *
16612  */
16613  __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
16614  __pyx_t_2 = __pyx_v_memslice->shape;
16615  __pyx_v_shape = __pyx_t_2;
16616 
16617  /* "View.MemoryView":949
16618  *
16619  * cdef Py_ssize_t *shape = memslice.shape
16620  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16621  *
16622  *
16623  */
16624  __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
16625  __pyx_t_2 = __pyx_v_memslice->strides;
16626  __pyx_v_strides = __pyx_t_2;
16627 
16628  /* "View.MemoryView":953
16629  *
16630  * cdef int i, j
16631  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16632  * j = ndim - 1 - i
16633  * strides[i], strides[j] = strides[j], strides[i]
16634  */
16635  __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16636  __pyx_t_3 = (__pyx_v_ndim / 2);
16637  __pyx_t_4 = __pyx_t_3;
16638  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16639  __pyx_v_i = __pyx_t_1;
16640 
16641  /* "View.MemoryView":954
16642  * cdef int i, j
16643  * for i in range(ndim / 2):
16644  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16645  * strides[i], strides[j] = strides[j], strides[i]
16646  * shape[i], shape[j] = shape[j], shape[i]
16647  */
16648  __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16649  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16650 
16651  /* "View.MemoryView":955
16652  * for i in range(ndim / 2):
16653  * j = ndim - 1 - i
16654  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16655  * shape[i], shape[j] = shape[j], shape[i]
16656  *
16657  */
16658  __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
16659  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16660  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16661  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16662  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16663 
16664  /* "View.MemoryView":956
16665  * j = ndim - 1 - i
16666  * strides[i], strides[j] = strides[j], strides[i]
16667  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16668  *
16669  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16670  */
16671  __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16672  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16673  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16674  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16675  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16676 
16677  /* "View.MemoryView":958
16678  * shape[i], shape[j] = shape[j], shape[i]
16679  *
16680  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16681  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16682  *
16683  */
16684  __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
16685  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16686  if (!__pyx_t_8) {
16687  } else {
16688  __pyx_t_7 = __pyx_t_8;
16689  goto __pyx_L6_bool_binop_done;
16690  }
16691  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16692  __pyx_t_7 = __pyx_t_8;
16693  __pyx_L6_bool_binop_done:;
16694  if (__pyx_t_7) {
16695 
16696  /* "View.MemoryView":959
16697  *
16698  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16699  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16700  *
16701  * return 1
16702  */
16703  __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16704  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
16705 
16706  /* "View.MemoryView":958
16707  * shape[i], shape[j] = shape[j], shape[i]
16708  *
16709  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16710  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16711  *
16712  */
16713  }
16714  }
16715 
16716  /* "View.MemoryView":961
16717  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16718  *
16719  * return 1 # <<<<<<<<<<<<<<
16720  *
16721  *
16722  */
16723  __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
16724  __pyx_r = 1;
16725  goto __pyx_L0;
16726 
16727  /* "View.MemoryView":945
16728  *
16729  * @cname('__pyx_memslice_transpose')
16730  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16731  * cdef int ndim = memslice.memview.view.ndim
16732  *
16733  */
16734 
16735  /* function exit code */
16736  __pyx_L1_error:;
16737  {
16738  #ifdef WITH_THREAD
16739  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16740  #endif
16741  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16742  #ifdef WITH_THREAD
16743  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16744  #endif
16745  }
16746  __pyx_r = 0;
16747  __pyx_L0:;
16748  __Pyx_TraceReturn(Py_None, 1);
16749  return __pyx_r;
16750 }
16751 
16752 /* "View.MemoryView":978
16753  * cdef int (*to_dtype_func)(char *, object) except 0
16754  *
16755  * def __dealloc__(self): # <<<<<<<<<<<<<<
16756  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16757  *
16758  */
16759 
16760 /* Python wrapper */
16761 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16762 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16763  __Pyx_RefNannyDeclarations
16764  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16765  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16766 
16767  /* function exit code */
16768  __Pyx_RefNannyFinishContext();
16769 }
16770 
16771 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16772  __Pyx_TraceDeclarations
16773  __Pyx_RefNannyDeclarations
16774  int __pyx_lineno = 0;
16775  const char *__pyx_filename = NULL;
16776  int __pyx_clineno = 0;
16777  __Pyx_RefNannySetupContext("__dealloc__", 0);
16778  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
16779 
16780  /* "View.MemoryView":979
16781  *
16782  * def __dealloc__(self):
16783  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16784  *
16785  * cdef convert_item_to_object(self, char *itemp):
16786  */
16787  __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
16788  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16789 
16790  /* "View.MemoryView":978
16791  * cdef int (*to_dtype_func)(char *, object) except 0
16792  *
16793  * def __dealloc__(self): # <<<<<<<<<<<<<<
16794  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16795  *
16796  */
16797 
16798  /* function exit code */
16799  goto __pyx_L0;
16800  __pyx_L1_error:;
16801  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16802  __pyx_L0:;
16803  __Pyx_TraceReturn(Py_None, 0);
16804  __Pyx_RefNannyFinishContext();
16805 }
16806 
16807 /* "View.MemoryView":981
16808  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16809  *
16810  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16811  * if self.to_object_func != NULL:
16812  * return self.to_object_func(itemp)
16813  */
16814 
16815 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16816  PyObject *__pyx_r = NULL;
16817  __Pyx_TraceDeclarations
16818  __Pyx_RefNannyDeclarations
16819  int __pyx_t_1;
16820  PyObject *__pyx_t_2 = NULL;
16821  int __pyx_lineno = 0;
16822  const char *__pyx_filename = NULL;
16823  int __pyx_clineno = 0;
16824  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16825  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
16826 
16827  /* "View.MemoryView":982
16828  *
16829  * cdef convert_item_to_object(self, char *itemp):
16830  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16831  * return self.to_object_func(itemp)
16832  * else:
16833  */
16834  __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
16835  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16836  if (__pyx_t_1) {
16837 
16838  /* "View.MemoryView":983
16839  * cdef convert_item_to_object(self, char *itemp):
16840  * if self.to_object_func != NULL:
16841  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16842  * else:
16843  * return memoryview.convert_item_to_object(self, itemp)
16844  */
16845  __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16846  __Pyx_XDECREF(__pyx_r);
16847  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16848  __Pyx_GOTREF(__pyx_t_2);
16849  __pyx_r = __pyx_t_2;
16850  __pyx_t_2 = 0;
16851  goto __pyx_L0;
16852 
16853  /* "View.MemoryView":982
16854  *
16855  * cdef convert_item_to_object(self, char *itemp):
16856  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16857  * return self.to_object_func(itemp)
16858  * else:
16859  */
16860  }
16861 
16862  /* "View.MemoryView":985
16863  * return self.to_object_func(itemp)
16864  * else:
16865  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16866  *
16867  * cdef assign_item_from_object(self, char *itemp, object value):
16868  */
16869  __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
16870  /*else*/ {
16871  __Pyx_XDECREF(__pyx_r);
16872  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
16873  __Pyx_GOTREF(__pyx_t_2);
16874  __pyx_r = __pyx_t_2;
16875  __pyx_t_2 = 0;
16876  goto __pyx_L0;
16877  }
16878 
16879  /* "View.MemoryView":981
16880  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16881  *
16882  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16883  * if self.to_object_func != NULL:
16884  * return self.to_object_func(itemp)
16885  */
16886 
16887  /* function exit code */
16888  __pyx_L1_error:;
16889  __Pyx_XDECREF(__pyx_t_2);
16890  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16891  __pyx_r = 0;
16892  __pyx_L0:;
16893  __Pyx_XGIVEREF(__pyx_r);
16894  __Pyx_TraceReturn(__pyx_r, 0);
16895  __Pyx_RefNannyFinishContext();
16896  return __pyx_r;
16897 }
16898 
16899 /* "View.MemoryView":987
16900  * return memoryview.convert_item_to_object(self, itemp)
16901  *
16902  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16903  * if self.to_dtype_func != NULL:
16904  * self.to_dtype_func(itemp, value)
16905  */
16906 
16907 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16908  PyObject *__pyx_r = NULL;
16909  __Pyx_TraceDeclarations
16910  __Pyx_RefNannyDeclarations
16911  int __pyx_t_1;
16912  int __pyx_t_2;
16913  PyObject *__pyx_t_3 = NULL;
16914  int __pyx_lineno = 0;
16915  const char *__pyx_filename = NULL;
16916  int __pyx_clineno = 0;
16917  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16918  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
16919 
16920  /* "View.MemoryView":988
16921  *
16922  * cdef assign_item_from_object(self, char *itemp, object value):
16923  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16924  * self.to_dtype_func(itemp, value)
16925  * else:
16926  */
16927  __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
16928  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16929  if (__pyx_t_1) {
16930 
16931  /* "View.MemoryView":989
16932  * cdef assign_item_from_object(self, char *itemp, object value):
16933  * if self.to_dtype_func != NULL:
16934  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16935  * else:
16936  * memoryview.assign_item_from_object(self, itemp, value)
16937  */
16938  __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
16939  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
16940 
16941  /* "View.MemoryView":988
16942  *
16943  * cdef assign_item_from_object(self, char *itemp, object value):
16944  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16945  * self.to_dtype_func(itemp, value)
16946  * else:
16947  */
16948  goto __pyx_L3;
16949  }
16950 
16951  /* "View.MemoryView":991
16952  * self.to_dtype_func(itemp, value)
16953  * else:
16954  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16955  *
16956  * @property
16957  */
16958  __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
16959  /*else*/ {
16960  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
16961  __Pyx_GOTREF(__pyx_t_3);
16962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16963  }
16964  __pyx_L3:;
16965 
16966  /* "View.MemoryView":987
16967  * return memoryview.convert_item_to_object(self, itemp)
16968  *
16969  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16970  * if self.to_dtype_func != NULL:
16971  * self.to_dtype_func(itemp, value)
16972  */
16973 
16974  /* function exit code */
16975  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16976  goto __pyx_L0;
16977  __pyx_L1_error:;
16978  __Pyx_XDECREF(__pyx_t_3);
16979  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16980  __pyx_r = 0;
16981  __pyx_L0:;
16982  __Pyx_XGIVEREF(__pyx_r);
16983  __Pyx_TraceReturn(__pyx_r, 0);
16984  __Pyx_RefNannyFinishContext();
16985  return __pyx_r;
16986 }
16987 
16988 /* "View.MemoryView":994
16989  *
16990  * @property
16991  * def base(self): # <<<<<<<<<<<<<<
16992  * return self.from_object
16993  *
16994  */
16995 
16996 /* Python wrapper */
16997 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16998 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16999  PyObject *__pyx_r = 0;
17000  __Pyx_RefNannyDeclarations
17001  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17002  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17003 
17004  /* function exit code */
17005  __Pyx_RefNannyFinishContext();
17006  return __pyx_r;
17007 }
17008 
17009 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17010  PyObject *__pyx_r = NULL;
17011  __Pyx_TraceDeclarations
17012  __Pyx_RefNannyDeclarations
17013  int __pyx_lineno = 0;
17014  const char *__pyx_filename = NULL;
17015  int __pyx_clineno = 0;
17016  __Pyx_RefNannySetupContext("__get__", 0);
17017  __Pyx_TraceCall("__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
17018 
17019  /* "View.MemoryView":995
17020  * @property
17021  * def base(self):
17022  * return self.from_object # <<<<<<<<<<<<<<
17023  *
17024  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17025  */
17026  __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
17027  __Pyx_XDECREF(__pyx_r);
17028  __Pyx_INCREF(__pyx_v_self->from_object);
17029  __pyx_r = __pyx_v_self->from_object;
17030  goto __pyx_L0;
17031 
17032  /* "View.MemoryView":994
17033  *
17034  * @property
17035  * def base(self): # <<<<<<<<<<<<<<
17036  * return self.from_object
17037  *
17038  */
17039 
17040  /* function exit code */
17041  __pyx_L1_error:;
17042  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17043  __pyx_r = NULL;
17044  __pyx_L0:;
17045  __Pyx_XGIVEREF(__pyx_r);
17046  __Pyx_TraceReturn(__pyx_r, 0);
17047  __Pyx_RefNannyFinishContext();
17048  return __pyx_r;
17049 }
17050 
17051 /* "(tree fragment)":1
17052  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17053  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17054  * def __setstate_cython__(self, __pyx_state):
17055  */
17056 
17057 /* Python wrapper */
17058 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17059 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17060 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17061  PyObject *__pyx_r = 0;
17062  __Pyx_RefNannyDeclarations
17063  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17064  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17065 
17066  /* function exit code */
17067  __Pyx_RefNannyFinishContext();
17068  return __pyx_r;
17069 }
17070 
17071 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17072  PyObject *__pyx_r = NULL;
17073  __Pyx_TraceDeclarations
17074  __Pyx_RefNannyDeclarations
17075  PyObject *__pyx_t_1 = NULL;
17076  int __pyx_lineno = 0;
17077  const char *__pyx_filename = NULL;
17078  int __pyx_clineno = 0;
17079  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17080  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17081 
17082  /* "(tree fragment)":2
17083  * def __reduce_cython__(self):
17084  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17085  * def __setstate_cython__(self, __pyx_state):
17086  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17087  */
17088  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
17089  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17090  __Pyx_GOTREF(__pyx_t_1);
17091  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17092  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17093  __PYX_ERR(1, 2, __pyx_L1_error)
17094 
17095  /* "(tree fragment)":1
17096  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17097  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17098  * def __setstate_cython__(self, __pyx_state):
17099  */
17100 
17101  /* function exit code */
17102  __pyx_L1_error:;
17103  __Pyx_XDECREF(__pyx_t_1);
17104  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17105  __pyx_r = NULL;
17106  __Pyx_XGIVEREF(__pyx_r);
17107  __Pyx_TraceReturn(__pyx_r, 0);
17108  __Pyx_RefNannyFinishContext();
17109  return __pyx_r;
17110 }
17111 
17112 /* "(tree fragment)":3
17113  * def __reduce_cython__(self):
17114  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17115  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17116  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17117  */
17118 
17119 /* Python wrapper */
17120 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17121 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17122 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17123  PyObject *__pyx_r = 0;
17124  __Pyx_RefNannyDeclarations
17125  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17126  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17127 
17128  /* function exit code */
17129  __Pyx_RefNannyFinishContext();
17130  return __pyx_r;
17131 }
17132 
17133 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17134  PyObject *__pyx_r = NULL;
17135  __Pyx_TraceDeclarations
17136  __Pyx_RefNannyDeclarations
17137  PyObject *__pyx_t_1 = NULL;
17138  int __pyx_lineno = 0;
17139  const char *__pyx_filename = NULL;
17140  int __pyx_clineno = 0;
17141  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17142  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17143 
17144  /* "(tree fragment)":4
17145  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17146  * def __setstate_cython__(self, __pyx_state):
17147  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17148  */
17149  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
17150  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17151  __Pyx_GOTREF(__pyx_t_1);
17152  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17153  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17154  __PYX_ERR(1, 4, __pyx_L1_error)
17155 
17156  /* "(tree fragment)":3
17157  * def __reduce_cython__(self):
17158  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17159  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17160  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17161  */
17162 
17163  /* function exit code */
17164  __pyx_L1_error:;
17165  __Pyx_XDECREF(__pyx_t_1);
17166  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17167  __pyx_r = NULL;
17168  __Pyx_XGIVEREF(__pyx_r);
17169  __Pyx_TraceReturn(__pyx_r, 0);
17170  __Pyx_RefNannyFinishContext();
17171  return __pyx_r;
17172 }
17173 
17174 /* "View.MemoryView":1001
17175  *
17176  * @cname('__pyx_memoryview_fromslice')
17177  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17178  * int ndim,
17179  * object (*to_object_func)(char *),
17180  */
17181 
17182 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17183  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17184  Py_ssize_t __pyx_v_suboffset;
17185  PyObject *__pyx_v_length = NULL;
17186  PyObject *__pyx_r = NULL;
17187  __Pyx_TraceDeclarations
17188  __Pyx_RefNannyDeclarations
17189  int __pyx_t_1;
17190  PyObject *__pyx_t_2 = NULL;
17191  PyObject *__pyx_t_3 = NULL;
17192  __Pyx_TypeInfo *__pyx_t_4;
17193  Py_buffer __pyx_t_5;
17194  Py_ssize_t *__pyx_t_6;
17195  Py_ssize_t *__pyx_t_7;
17196  Py_ssize_t *__pyx_t_8;
17197  Py_ssize_t __pyx_t_9;
17198  int __pyx_lineno = 0;
17199  const char *__pyx_filename = NULL;
17200  int __pyx_clineno = 0;
17201  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17202  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
17203 
17204  /* "View.MemoryView":1009
17205  * cdef _memoryviewslice result
17206  *
17207  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17208  * return None
17209  *
17210  */
17211  __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
17212  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17213  if (__pyx_t_1) {
17214 
17215  /* "View.MemoryView":1010
17216  *
17217  * if <PyObject *> memviewslice.memview == Py_None:
17218  * return None # <<<<<<<<<<<<<<
17219  *
17220  *
17221  */
17222  __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
17223  __Pyx_XDECREF(__pyx_r);
17224  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17225  goto __pyx_L0;
17226 
17227  /* "View.MemoryView":1009
17228  * cdef _memoryviewslice result
17229  *
17230  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17231  * return None
17232  *
17233  */
17234  }
17235 
17236  /* "View.MemoryView":1015
17237  *
17238  *
17239  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17240  *
17241  * result.from_slice = memviewslice
17242  */
17243  __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
17244  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17245  __Pyx_GOTREF(__pyx_t_2);
17246  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
17247  __Pyx_GOTREF(__pyx_t_3);
17248  __Pyx_INCREF(Py_None);
17249  __Pyx_GIVEREF(Py_None);
17250  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17251  __Pyx_INCREF(__pyx_int_0);
17252  __Pyx_GIVEREF(__pyx_int_0);
17253  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17254  __Pyx_GIVEREF(__pyx_t_2);
17255  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17256  __pyx_t_2 = 0;
17257  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17258  __Pyx_GOTREF(__pyx_t_2);
17259  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17260  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17261  __pyx_t_2 = 0;
17262 
17263  /* "View.MemoryView":1017
17264  * result = _memoryviewslice(None, 0, dtype_is_object)
17265  *
17266  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17267  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17268  *
17269  */
17270  __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
17271  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17272 
17273  /* "View.MemoryView":1018
17274  *
17275  * result.from_slice = memviewslice
17276  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17277  *
17278  * result.from_object = (<memoryview> memviewslice.memview).base
17279  */
17280  __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
17281  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17282 
17283  /* "View.MemoryView":1020
17284  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17285  *
17286  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17287  * result.typeinfo = memviewslice.memview.typeinfo
17288  *
17289  */
17290  __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
17291  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
17292  __Pyx_GOTREF(__pyx_t_2);
17293  __Pyx_GIVEREF(__pyx_t_2);
17294  __Pyx_GOTREF(__pyx_v_result->from_object);
17295  __Pyx_DECREF(__pyx_v_result->from_object);
17296  __pyx_v_result->from_object = __pyx_t_2;
17297  __pyx_t_2 = 0;
17298 
17299  /* "View.MemoryView":1021
17300  *
17301  * result.from_object = (<memoryview> memviewslice.memview).base
17302  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17303  *
17304  * result.view = memviewslice.memview.view
17305  */
17306  __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
17307  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17308  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17309 
17310  /* "View.MemoryView":1023
17311  * result.typeinfo = memviewslice.memview.typeinfo
17312  *
17313  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17314  * result.view.buf = <void *> memviewslice.data
17315  * result.view.ndim = ndim
17316  */
17317  __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
17318  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17319  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17320 
17321  /* "View.MemoryView":1024
17322  *
17323  * result.view = memviewslice.memview.view
17324  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17325  * result.view.ndim = ndim
17326  * (<__pyx_buffer *> &result.view).obj = Py_None
17327  */
17328  __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
17329  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17330 
17331  /* "View.MemoryView":1025
17332  * result.view = memviewslice.memview.view
17333  * result.view.buf = <void *> memviewslice.data
17334  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17335  * (<__pyx_buffer *> &result.view).obj = Py_None
17336  * Py_INCREF(Py_None)
17337  */
17338  __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
17339  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17340 
17341  /* "View.MemoryView":1026
17342  * result.view.buf = <void *> memviewslice.data
17343  * result.view.ndim = ndim
17344  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17345  * Py_INCREF(Py_None)
17346  *
17347  */
17348  __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
17349  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17350 
17351  /* "View.MemoryView":1027
17352  * result.view.ndim = ndim
17353  * (<__pyx_buffer *> &result.view).obj = Py_None
17354  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17355  *
17356  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17357  */
17358  __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
17359  Py_INCREF(Py_None);
17360 
17361  /* "View.MemoryView":1029
17362  * Py_INCREF(Py_None)
17363  *
17364  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17365  * result.flags = PyBUF_RECORDS
17366  * else:
17367  */
17368  __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
17369  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17370  if (__pyx_t_1) {
17371 
17372  /* "View.MemoryView":1030
17373  *
17374  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17375  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17376  * else:
17377  * result.flags = PyBUF_RECORDS_RO
17378  */
17379  __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
17380  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17381 
17382  /* "View.MemoryView":1029
17383  * Py_INCREF(Py_None)
17384  *
17385  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17386  * result.flags = PyBUF_RECORDS
17387  * else:
17388  */
17389  goto __pyx_L4;
17390  }
17391 
17392  /* "View.MemoryView":1032
17393  * result.flags = PyBUF_RECORDS
17394  * else:
17395  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17396  *
17397  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17398  */
17399  __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
17400  /*else*/ {
17401  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17402  }
17403  __pyx_L4:;
17404 
17405  /* "View.MemoryView":1034
17406  * result.flags = PyBUF_RECORDS_RO
17407  *
17408  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17409  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17410  *
17411  */
17412  __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
17413  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17414 
17415  /* "View.MemoryView":1035
17416  *
17417  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17418  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17419  *
17420  *
17421  */
17422  __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
17423  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17424 
17425  /* "View.MemoryView":1038
17426  *
17427  *
17428  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17429  * for suboffset in result.from_slice.suboffsets[:ndim]:
17430  * if suboffset >= 0:
17431  */
17432  __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
17433  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17434 
17435  /* "View.MemoryView":1039
17436  *
17437  * result.view.suboffsets = NULL
17438  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17439  * if suboffset >= 0:
17440  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17441  */
17442  __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
17443  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17444  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17445  __pyx_t_6 = __pyx_t_8;
17446  __pyx_v_suboffset = (__pyx_t_6[0]);
17447 
17448  /* "View.MemoryView":1040
17449  * result.view.suboffsets = NULL
17450  * for suboffset in result.from_slice.suboffsets[:ndim]:
17451  * if suboffset >= 0: # <<<<<<<<<<<<<<
17452  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17453  * break
17454  */
17455  __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
17456  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17457  if (__pyx_t_1) {
17458 
17459  /* "View.MemoryView":1041
17460  * for suboffset in result.from_slice.suboffsets[:ndim]:
17461  * if suboffset >= 0:
17462  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17463  * break
17464  *
17465  */
17466  __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
17467  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17468 
17469  /* "View.MemoryView":1042
17470  * if suboffset >= 0:
17471  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17472  * break # <<<<<<<<<<<<<<
17473  *
17474  * result.view.len = result.view.itemsize
17475  */
17476  __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
17477  goto __pyx_L6_break;
17478 
17479  /* "View.MemoryView":1040
17480  * result.view.suboffsets = NULL
17481  * for suboffset in result.from_slice.suboffsets[:ndim]:
17482  * if suboffset >= 0: # <<<<<<<<<<<<<<
17483  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17484  * break
17485  */
17486  }
17487  }
17488  __pyx_L6_break:;
17489 
17490  /* "View.MemoryView":1044
17491  * break
17492  *
17493  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17494  * for length in result.view.shape[:ndim]:
17495  * result.view.len *= length
17496  */
17497  __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
17498  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17499  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17500 
17501  /* "View.MemoryView":1045
17502  *
17503  * result.view.len = result.view.itemsize
17504  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17505  * result.view.len *= length
17506  *
17507  */
17508  __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
17509  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17510  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17511  __pyx_t_6 = __pyx_t_8;
17512  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
17513  __Pyx_GOTREF(__pyx_t_2);
17514  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17515  __pyx_t_2 = 0;
17516 
17517  /* "View.MemoryView":1046
17518  * result.view.len = result.view.itemsize
17519  * for length in result.view.shape[:ndim]:
17520  * result.view.len *= length # <<<<<<<<<<<<<<
17521  *
17522  * result.to_object_func = to_object_func
17523  */
17524  __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
17525  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
17526  __Pyx_GOTREF(__pyx_t_2);
17527  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
17528  __Pyx_GOTREF(__pyx_t_3);
17529  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17530  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
17531  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17532  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17533  }
17534 
17535  /* "View.MemoryView":1048
17536  * result.view.len *= length
17537  *
17538  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17539  * result.to_dtype_func = to_dtype_func
17540  *
17541  */
17542  __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
17543  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17544 
17545  /* "View.MemoryView":1049
17546  *
17547  * result.to_object_func = to_object_func
17548  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17549  *
17550  * return result
17551  */
17552  __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
17553  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17554 
17555  /* "View.MemoryView":1051
17556  * result.to_dtype_func = to_dtype_func
17557  *
17558  * return result # <<<<<<<<<<<<<<
17559  *
17560  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17561  */
17562  __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
17563  __Pyx_XDECREF(__pyx_r);
17564  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17565  __pyx_r = ((PyObject *)__pyx_v_result);
17566  goto __pyx_L0;
17567 
17568  /* "View.MemoryView":1001
17569  *
17570  * @cname('__pyx_memoryview_fromslice')
17571  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17572  * int ndim,
17573  * object (*to_object_func)(char *),
17574  */
17575 
17576  /* function exit code */
17577  __pyx_L1_error:;
17578  __Pyx_XDECREF(__pyx_t_2);
17579  __Pyx_XDECREF(__pyx_t_3);
17580  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17581  __pyx_r = 0;
17582  __pyx_L0:;
17583  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17584  __Pyx_XDECREF(__pyx_v_length);
17585  __Pyx_XGIVEREF(__pyx_r);
17586  __Pyx_TraceReturn(__pyx_r, 0);
17587  __Pyx_RefNannyFinishContext();
17588  return __pyx_r;
17589 }
17590 
17591 /* "View.MemoryView":1054
17592  *
17593  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17594  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17595  * __Pyx_memviewslice *mslice) except NULL:
17596  * cdef _memoryviewslice obj
17597  */
17598 
17599 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17600  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17601  __Pyx_memviewslice *__pyx_r;
17602  __Pyx_TraceDeclarations
17603  __Pyx_RefNannyDeclarations
17604  int __pyx_t_1;
17605  int __pyx_t_2;
17606  PyObject *__pyx_t_3 = NULL;
17607  int __pyx_lineno = 0;
17608  const char *__pyx_filename = NULL;
17609  int __pyx_clineno = 0;
17610  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17611  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
17612 
17613  /* "View.MemoryView":1057
17614  * __Pyx_memviewslice *mslice) except NULL:
17615  * cdef _memoryviewslice obj
17616  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17617  * obj = memview
17618  * return &obj.from_slice
17619  */
17620  __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17621  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17622  __pyx_t_2 = (__pyx_t_1 != 0);
17623  if (__pyx_t_2) {
17624 
17625  /* "View.MemoryView":1058
17626  * cdef _memoryviewslice obj
17627  * if isinstance(memview, _memoryviewslice):
17628  * obj = memview # <<<<<<<<<<<<<<
17629  * return &obj.from_slice
17630  * else:
17631  */
17632  __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
17633  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
17634  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17635  __Pyx_INCREF(__pyx_t_3);
17636  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17637  __pyx_t_3 = 0;
17638 
17639  /* "View.MemoryView":1059
17640  * if isinstance(memview, _memoryviewslice):
17641  * obj = memview
17642  * return &obj.from_slice # <<<<<<<<<<<<<<
17643  * else:
17644  * slice_copy(memview, mslice)
17645  */
17646  __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17647  __pyx_r = (&__pyx_v_obj->from_slice);
17648  goto __pyx_L0;
17649 
17650  /* "View.MemoryView":1057
17651  * __Pyx_memviewslice *mslice) except NULL:
17652  * cdef _memoryviewslice obj
17653  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17654  * obj = memview
17655  * return &obj.from_slice
17656  */
17657  }
17658 
17659  /* "View.MemoryView":1061
17660  * return &obj.from_slice
17661  * else:
17662  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17663  * return mslice
17664  *
17665  */
17666  __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
17667  /*else*/ {
17668  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17669 
17670  /* "View.MemoryView":1062
17671  * else:
17672  * slice_copy(memview, mslice)
17673  * return mslice # <<<<<<<<<<<<<<
17674  *
17675  * @cname('__pyx_memoryview_slice_copy')
17676  */
17677  __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
17678  __pyx_r = __pyx_v_mslice;
17679  goto __pyx_L0;
17680  }
17681 
17682  /* "View.MemoryView":1054
17683  *
17684  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17685  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17686  * __Pyx_memviewslice *mslice) except NULL:
17687  * cdef _memoryviewslice obj
17688  */
17689 
17690  /* function exit code */
17691  __pyx_L1_error:;
17692  __Pyx_XDECREF(__pyx_t_3);
17693  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17694  __pyx_r = NULL;
17695  __pyx_L0:;
17696  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17697  __Pyx_TraceReturn(Py_None, 0);
17698  __Pyx_RefNannyFinishContext();
17699  return __pyx_r;
17700 }
17701 
17702 /* "View.MemoryView":1065
17703  *
17704  * @cname('__pyx_memoryview_slice_copy')
17705  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17706  * cdef int dim
17707  * cdef (Py_ssize_t*) shape, strides, suboffsets
17708  */
17709 
17710 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17711  int __pyx_v_dim;
17712  Py_ssize_t *__pyx_v_shape;
17713  Py_ssize_t *__pyx_v_strides;
17714  Py_ssize_t *__pyx_v_suboffsets;
17715  __Pyx_TraceDeclarations
17716  __Pyx_RefNannyDeclarations
17717  Py_ssize_t *__pyx_t_1;
17718  int __pyx_t_2;
17719  int __pyx_t_3;
17720  int __pyx_t_4;
17721  Py_ssize_t __pyx_t_5;
17722  int __pyx_lineno = 0;
17723  const char *__pyx_filename = NULL;
17724  int __pyx_clineno = 0;
17725  __Pyx_RefNannySetupContext("slice_copy", 0);
17726  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
17727 
17728  /* "View.MemoryView":1069
17729  * cdef (Py_ssize_t*) shape, strides, suboffsets
17730  *
17731  * shape = memview.view.shape # <<<<<<<<<<<<<<
17732  * strides = memview.view.strides
17733  * suboffsets = memview.view.suboffsets
17734  */
17735  __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17736  __pyx_t_1 = __pyx_v_memview->view.shape;
17737  __pyx_v_shape = __pyx_t_1;
17738 
17739  /* "View.MemoryView":1070
17740  *
17741  * shape = memview.view.shape
17742  * strides = memview.view.strides # <<<<<<<<<<<<<<
17743  * suboffsets = memview.view.suboffsets
17744  *
17745  */
17746  __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
17747  __pyx_t_1 = __pyx_v_memview->view.strides;
17748  __pyx_v_strides = __pyx_t_1;
17749 
17750  /* "View.MemoryView":1071
17751  * shape = memview.view.shape
17752  * strides = memview.view.strides
17753  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17754  *
17755  * dst.memview = <__pyx_memoryview *> memview
17756  */
17757  __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17758  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17759  __pyx_v_suboffsets = __pyx_t_1;
17760 
17761  /* "View.MemoryView":1073
17762  * suboffsets = memview.view.suboffsets
17763  *
17764  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17765  * dst.data = <char *> memview.view.buf
17766  *
17767  */
17768  __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
17769  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17770 
17771  /* "View.MemoryView":1074
17772  *
17773  * dst.memview = <__pyx_memoryview *> memview
17774  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17775  *
17776  * for dim in range(memview.view.ndim):
17777  */
17778  __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17779  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17780 
17781  /* "View.MemoryView":1076
17782  * dst.data = <char *> memview.view.buf
17783  *
17784  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17785  * dst.shape[dim] = shape[dim]
17786  * dst.strides[dim] = strides[dim]
17787  */
17788  __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17789  __pyx_t_2 = __pyx_v_memview->view.ndim;
17790  __pyx_t_3 = __pyx_t_2;
17791  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17792  __pyx_v_dim = __pyx_t_4;
17793 
17794  /* "View.MemoryView":1077
17795  *
17796  * for dim in range(memview.view.ndim):
17797  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17798  * dst.strides[dim] = strides[dim]
17799  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17800  */
17801  __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17802  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17803 
17804  /* "View.MemoryView":1078
17805  * for dim in range(memview.view.ndim):
17806  * dst.shape[dim] = shape[dim]
17807  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17808  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17809  *
17810  */
17811  __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
17812  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17813 
17814  /* "View.MemoryView":1079
17815  * dst.shape[dim] = shape[dim]
17816  * dst.strides[dim] = strides[dim]
17817  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17818  *
17819  * @cname('__pyx_memoryview_copy_object')
17820  */
17821  __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
17822  if ((__pyx_v_suboffsets != 0)) {
17823  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17824  } else {
17825  __pyx_t_5 = -1L;
17826  }
17827  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17828  }
17829 
17830  /* "View.MemoryView":1065
17831  *
17832  * @cname('__pyx_memoryview_slice_copy')
17833  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17834  * cdef int dim
17835  * cdef (Py_ssize_t*) shape, strides, suboffsets
17836  */
17837 
17838  /* function exit code */
17839  goto __pyx_L0;
17840  __pyx_L1_error:;
17841  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17842  __pyx_L0:;
17843  __Pyx_TraceReturn(Py_None, 0);
17844  __Pyx_RefNannyFinishContext();
17845 }
17846 
17847 /* "View.MemoryView":1082
17848  *
17849  * @cname('__pyx_memoryview_copy_object')
17850  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17851  * "Create a new memoryview object"
17852  * cdef __Pyx_memviewslice memviewslice
17853  */
17854 
17855 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17856  __Pyx_memviewslice __pyx_v_memviewslice;
17857  PyObject *__pyx_r = NULL;
17858  __Pyx_TraceDeclarations
17859  __Pyx_RefNannyDeclarations
17860  PyObject *__pyx_t_1 = NULL;
17861  int __pyx_lineno = 0;
17862  const char *__pyx_filename = NULL;
17863  int __pyx_clineno = 0;
17864  __Pyx_RefNannySetupContext("memoryview_copy", 0);
17865  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
17866 
17867  /* "View.MemoryView":1085
17868  * "Create a new memoryview object"
17869  * cdef __Pyx_memviewslice memviewslice
17870  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17871  * return memoryview_copy_from_slice(memview, &memviewslice)
17872  *
17873  */
17874  __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
17875  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17876 
17877  /* "View.MemoryView":1086
17878  * cdef __Pyx_memviewslice memviewslice
17879  * slice_copy(memview, &memviewslice)
17880  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17881  *
17882  * @cname('__pyx_memoryview_copy_object_from_slice')
17883  */
17884  __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
17885  __Pyx_XDECREF(__pyx_r);
17886  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
17887  __Pyx_GOTREF(__pyx_t_1);
17888  __pyx_r = __pyx_t_1;
17889  __pyx_t_1 = 0;
17890  goto __pyx_L0;
17891 
17892  /* "View.MemoryView":1082
17893  *
17894  * @cname('__pyx_memoryview_copy_object')
17895  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17896  * "Create a new memoryview object"
17897  * cdef __Pyx_memviewslice memviewslice
17898  */
17899 
17900  /* function exit code */
17901  __pyx_L1_error:;
17902  __Pyx_XDECREF(__pyx_t_1);
17903  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17904  __pyx_r = 0;
17905  __pyx_L0:;
17906  __Pyx_XGIVEREF(__pyx_r);
17907  __Pyx_TraceReturn(__pyx_r, 0);
17908  __Pyx_RefNannyFinishContext();
17909  return __pyx_r;
17910 }
17911 
17912 /* "View.MemoryView":1089
17913  *
17914  * @cname('__pyx_memoryview_copy_object_from_slice')
17915  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17916  * """
17917  * Create a new memoryview object from a given memoryview object and slice.
17918  */
17919 
17920 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17921  PyObject *(*__pyx_v_to_object_func)(char *);
17922  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17923  PyObject *__pyx_r = NULL;
17924  __Pyx_TraceDeclarations
17925  __Pyx_RefNannyDeclarations
17926  int __pyx_t_1;
17927  int __pyx_t_2;
17928  PyObject *(*__pyx_t_3)(char *);
17929  int (*__pyx_t_4)(char *, PyObject *);
17930  PyObject *__pyx_t_5 = NULL;
17931  int __pyx_lineno = 0;
17932  const char *__pyx_filename = NULL;
17933  int __pyx_clineno = 0;
17934  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17935  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
17936 
17937  /* "View.MemoryView":1096
17938  * cdef int (*to_dtype_func)(char *, object) except 0
17939  *
17940  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17941  * to_object_func = (<_memoryviewslice> memview).to_object_func
17942  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17943  */
17944  __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
17945  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17946  __pyx_t_2 = (__pyx_t_1 != 0);
17947  if (__pyx_t_2) {
17948 
17949  /* "View.MemoryView":1097
17950  *
17951  * if isinstance(memview, _memoryviewslice):
17952  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17953  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17954  * else:
17955  */
17956  __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
17957  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17958  __pyx_v_to_object_func = __pyx_t_3;
17959 
17960  /* "View.MemoryView":1098
17961  * if isinstance(memview, _memoryviewslice):
17962  * to_object_func = (<_memoryviewslice> memview).to_object_func
17963  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17964  * else:
17965  * to_object_func = NULL
17966  */
17967  __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
17968  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17969  __pyx_v_to_dtype_func = __pyx_t_4;
17970 
17971  /* "View.MemoryView":1096
17972  * cdef int (*to_dtype_func)(char *, object) except 0
17973  *
17974  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17975  * to_object_func = (<_memoryviewslice> memview).to_object_func
17976  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17977  */
17978  goto __pyx_L3;
17979  }
17980 
17981  /* "View.MemoryView":1100
17982  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17983  * else:
17984  * to_object_func = NULL # <<<<<<<<<<<<<<
17985  * to_dtype_func = NULL
17986  *
17987  */
17988  __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
17989  /*else*/ {
17990  __pyx_v_to_object_func = NULL;
17991 
17992  /* "View.MemoryView":1101
17993  * else:
17994  * to_object_func = NULL
17995  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17996  *
17997  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17998  */
17999  __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
18000  __pyx_v_to_dtype_func = NULL;
18001  }
18002  __pyx_L3:;
18003 
18004  /* "View.MemoryView":1103
18005  * to_dtype_func = NULL
18006  *
18007  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18008  * to_object_func, to_dtype_func,
18009  * memview.dtype_is_object)
18010  */
18011  __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
18012  __Pyx_XDECREF(__pyx_r);
18013 
18014  /* "View.MemoryView":1105
18015  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18016  * to_object_func, to_dtype_func,
18017  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18018  *
18019  *
18020  */
18021  __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
18022  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
18023  __Pyx_GOTREF(__pyx_t_5);
18024  __pyx_r = __pyx_t_5;
18025  __pyx_t_5 = 0;
18026  goto __pyx_L0;
18027 
18028  /* "View.MemoryView":1089
18029  *
18030  * @cname('__pyx_memoryview_copy_object_from_slice')
18031  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18032  * """
18033  * Create a new memoryview object from a given memoryview object and slice.
18034  */
18035 
18036  /* function exit code */
18037  __pyx_L1_error:;
18038  __Pyx_XDECREF(__pyx_t_5);
18039  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18040  __pyx_r = 0;
18041  __pyx_L0:;
18042  __Pyx_XGIVEREF(__pyx_r);
18043  __Pyx_TraceReturn(__pyx_r, 0);
18044  __Pyx_RefNannyFinishContext();
18045  return __pyx_r;
18046 }
18047 
18048 /* "View.MemoryView":1111
18049  *
18050  *
18051  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18052  * if arg < 0:
18053  * return -arg
18054  */
18055 
18056 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18057  Py_ssize_t __pyx_r;
18058  __Pyx_TraceDeclarations
18059  int __pyx_t_1;
18060  int __pyx_lineno = 0;
18061  const char *__pyx_filename = NULL;
18062  int __pyx_clineno = 0;
18063  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
18064 
18065  /* "View.MemoryView":1112
18066  *
18067  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18068  * if arg < 0: # <<<<<<<<<<<<<<
18069  * return -arg
18070  * else:
18071  */
18072  __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
18073  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18074  if (__pyx_t_1) {
18075 
18076  /* "View.MemoryView":1113
18077  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18078  * if arg < 0:
18079  * return -arg # <<<<<<<<<<<<<<
18080  * else:
18081  * return arg
18082  */
18083  __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
18084  __pyx_r = (-__pyx_v_arg);
18085  goto __pyx_L0;
18086 
18087  /* "View.MemoryView":1112
18088  *
18089  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18090  * if arg < 0: # <<<<<<<<<<<<<<
18091  * return -arg
18092  * else:
18093  */
18094  }
18095 
18096  /* "View.MemoryView":1115
18097  * return -arg
18098  * else:
18099  * return arg # <<<<<<<<<<<<<<
18100  *
18101  * @cname('__pyx_get_best_slice_order')
18102  */
18103  __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
18104  /*else*/ {
18105  __pyx_r = __pyx_v_arg;
18106  goto __pyx_L0;
18107  }
18108 
18109  /* "View.MemoryView":1111
18110  *
18111  *
18112  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18113  * if arg < 0:
18114  * return -arg
18115  */
18116 
18117  /* function exit code */
18118  __pyx_L1_error:;
18119  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18120  __pyx_r = 0;
18121  __pyx_L0:;
18122  __Pyx_TraceReturn(Py_None, 1);
18123  return __pyx_r;
18124 }
18125 
18126 /* "View.MemoryView":1118
18127  *
18128  * @cname('__pyx_get_best_slice_order')
18129  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18130  * """
18131  * Figure out the best memory access order for a given slice.
18132  */
18133 
18134 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18135  int __pyx_v_i;
18136  Py_ssize_t __pyx_v_c_stride;
18137  Py_ssize_t __pyx_v_f_stride;
18138  char __pyx_r;
18139  __Pyx_TraceDeclarations
18140  int __pyx_t_1;
18141  int __pyx_t_2;
18142  int __pyx_t_3;
18143  int __pyx_t_4;
18144  int __pyx_lineno = 0;
18145  const char *__pyx_filename = NULL;
18146  int __pyx_clineno = 0;
18147  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
18148 
18149  /* "View.MemoryView":1123
18150  * """
18151  * cdef int i
18152  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18153  * cdef Py_ssize_t f_stride = 0
18154  *
18155  */
18156  __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
18157  __pyx_v_c_stride = 0;
18158 
18159  /* "View.MemoryView":1124
18160  * cdef int i
18161  * cdef Py_ssize_t c_stride = 0
18162  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18163  *
18164  * for i in range(ndim - 1, -1, -1):
18165  */
18166  __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
18167  __pyx_v_f_stride = 0;
18168 
18169  /* "View.MemoryView":1126
18170  * cdef Py_ssize_t f_stride = 0
18171  *
18172  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18173  * if mslice.shape[i] > 1:
18174  * c_stride = mslice.strides[i]
18175  */
18176  __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
18177  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18178  __pyx_v_i = __pyx_t_1;
18179 
18180  /* "View.MemoryView":1127
18181  *
18182  * for i in range(ndim - 1, -1, -1):
18183  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18184  * c_stride = mslice.strides[i]
18185  * break
18186  */
18187  __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
18188  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18189  if (__pyx_t_2) {
18190 
18191  /* "View.MemoryView":1128
18192  * for i in range(ndim - 1, -1, -1):
18193  * if mslice.shape[i] > 1:
18194  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18195  * break
18196  *
18197  */
18198  __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
18199  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18200 
18201  /* "View.MemoryView":1129
18202  * if mslice.shape[i] > 1:
18203  * c_stride = mslice.strides[i]
18204  * break # <<<<<<<<<<<<<<
18205  *
18206  * for i in range(ndim):
18207  */
18208  __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
18209  goto __pyx_L4_break;
18210 
18211  /* "View.MemoryView":1127
18212  *
18213  * for i in range(ndim - 1, -1, -1):
18214  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18215  * c_stride = mslice.strides[i]
18216  * break
18217  */
18218  }
18219  }
18220  __pyx_L4_break:;
18221 
18222  /* "View.MemoryView":1131
18223  * break
18224  *
18225  * for i in range(ndim): # <<<<<<<<<<<<<<
18226  * if mslice.shape[i] > 1:
18227  * f_stride = mslice.strides[i]
18228  */
18229  __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
18230  __pyx_t_1 = __pyx_v_ndim;
18231  __pyx_t_3 = __pyx_t_1;
18232  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18233  __pyx_v_i = __pyx_t_4;
18234 
18235  /* "View.MemoryView":1132
18236  *
18237  * for i in range(ndim):
18238  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18239  * f_stride = mslice.strides[i]
18240  * break
18241  */
18242  __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
18243  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18244  if (__pyx_t_2) {
18245 
18246  /* "View.MemoryView":1133
18247  * for i in range(ndim):
18248  * if mslice.shape[i] > 1:
18249  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18250  * break
18251  *
18252  */
18253  __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
18254  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18255 
18256  /* "View.MemoryView":1134
18257  * if mslice.shape[i] > 1:
18258  * f_stride = mslice.strides[i]
18259  * break # <<<<<<<<<<<<<<
18260  *
18261  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18262  */
18263  __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
18264  goto __pyx_L7_break;
18265 
18266  /* "View.MemoryView":1132
18267  *
18268  * for i in range(ndim):
18269  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18270  * f_stride = mslice.strides[i]
18271  * break
18272  */
18273  }
18274  }
18275  __pyx_L7_break:;
18276 
18277  /* "View.MemoryView":1136
18278  * break
18279  *
18280  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18281  * return 'C'
18282  * else:
18283  */
18284  __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
18285  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18286  if (__pyx_t_2) {
18287 
18288  /* "View.MemoryView":1137
18289  *
18290  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18291  * return 'C' # <<<<<<<<<<<<<<
18292  * else:
18293  * return 'F'
18294  */
18295  __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
18296  __pyx_r = 'C';
18297  goto __pyx_L0;
18298 
18299  /* "View.MemoryView":1136
18300  * break
18301  *
18302  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18303  * return 'C'
18304  * else:
18305  */
18306  }
18307 
18308  /* "View.MemoryView":1139
18309  * return 'C'
18310  * else:
18311  * return 'F' # <<<<<<<<<<<<<<
18312  *
18313  * @cython.cdivision(True)
18314  */
18315  __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
18316  /*else*/ {
18317  __pyx_r = 'F';
18318  goto __pyx_L0;
18319  }
18320 
18321  /* "View.MemoryView":1118
18322  *
18323  * @cname('__pyx_get_best_slice_order')
18324  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18325  * """
18326  * Figure out the best memory access order for a given slice.
18327  */
18328 
18329  /* function exit code */
18330  __pyx_L1_error:;
18331  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18332  __pyx_r = 0;
18333  __pyx_L0:;
18334  __Pyx_TraceReturn(Py_None, 1);
18335  return __pyx_r;
18336 }
18337 
18338 /* "View.MemoryView":1142
18339  *
18340  * @cython.cdivision(True)
18341  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18342  * char *dst_data, Py_ssize_t *dst_strides,
18343  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18344  */
18345 
18346 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18347  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18348  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18349  Py_ssize_t __pyx_v_dst_extent;
18350  Py_ssize_t __pyx_v_src_stride;
18351  Py_ssize_t __pyx_v_dst_stride;
18352  int __pyx_t_1;
18353  int __pyx_t_2;
18354  int __pyx_t_3;
18355  Py_ssize_t __pyx_t_4;
18356  Py_ssize_t __pyx_t_5;
18357  Py_ssize_t __pyx_t_6;
18358 
18359  /* "View.MemoryView":1149
18360  *
18361  * cdef Py_ssize_t i
18362  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18363  * cdef Py_ssize_t dst_extent = dst_shape[0]
18364  * cdef Py_ssize_t src_stride = src_strides[0]
18365  */
18366  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18367 
18368  /* "View.MemoryView":1150
18369  * cdef Py_ssize_t i
18370  * cdef Py_ssize_t src_extent = src_shape[0]
18371  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18372  * cdef Py_ssize_t src_stride = src_strides[0]
18373  * cdef Py_ssize_t dst_stride = dst_strides[0]
18374  */
18375  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18376 
18377  /* "View.MemoryView":1151
18378  * cdef Py_ssize_t src_extent = src_shape[0]
18379  * cdef Py_ssize_t dst_extent = dst_shape[0]
18380  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18381  * cdef Py_ssize_t dst_stride = dst_strides[0]
18382  *
18383  */
18384  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18385 
18386  /* "View.MemoryView":1152
18387  * cdef Py_ssize_t dst_extent = dst_shape[0]
18388  * cdef Py_ssize_t src_stride = src_strides[0]
18389  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18390  *
18391  * if ndim == 1:
18392  */
18393  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18394 
18395  /* "View.MemoryView":1154
18396  * cdef Py_ssize_t dst_stride = dst_strides[0]
18397  *
18398  * if ndim == 1: # <<<<<<<<<<<<<<
18399  * if (src_stride > 0 and dst_stride > 0 and
18400  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18401  */
18402  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18403  if (__pyx_t_1) {
18404 
18405  /* "View.MemoryView":1155
18406  *
18407  * if ndim == 1:
18408  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18409  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18410  * memcpy(dst_data, src_data, itemsize * dst_extent)
18411  */
18412  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18413  if (__pyx_t_2) {
18414  } else {
18415  __pyx_t_1 = __pyx_t_2;
18416  goto __pyx_L5_bool_binop_done;
18417  }
18418  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18419  if (__pyx_t_2) {
18420  } else {
18421  __pyx_t_1 = __pyx_t_2;
18422  goto __pyx_L5_bool_binop_done;
18423  }
18424 
18425  /* "View.MemoryView":1156
18426  * if ndim == 1:
18427  * if (src_stride > 0 and dst_stride > 0 and
18428  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18429  * memcpy(dst_data, src_data, itemsize * dst_extent)
18430  * else:
18431  */
18432  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18433  if (__pyx_t_2) {
18434  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18435  }
18436  __pyx_t_3 = (__pyx_t_2 != 0);
18437  __pyx_t_1 = __pyx_t_3;
18438  __pyx_L5_bool_binop_done:;
18439 
18440  /* "View.MemoryView":1155
18441  *
18442  * if ndim == 1:
18443  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18444  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18445  * memcpy(dst_data, src_data, itemsize * dst_extent)
18446  */
18447  if (__pyx_t_1) {
18448 
18449  /* "View.MemoryView":1157
18450  * if (src_stride > 0 and dst_stride > 0 and
18451  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18452  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18453  * else:
18454  * for i in range(dst_extent):
18455  */
18456  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18457 
18458  /* "View.MemoryView":1155
18459  *
18460  * if ndim == 1:
18461  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18462  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18463  * memcpy(dst_data, src_data, itemsize * dst_extent)
18464  */
18465  goto __pyx_L4;
18466  }
18467 
18468  /* "View.MemoryView":1159
18469  * memcpy(dst_data, src_data, itemsize * dst_extent)
18470  * else:
18471  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18472  * memcpy(dst_data, src_data, itemsize)
18473  * src_data += src_stride
18474  */
18475  /*else*/ {
18476  __pyx_t_4 = __pyx_v_dst_extent;
18477  __pyx_t_5 = __pyx_t_4;
18478  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18479  __pyx_v_i = __pyx_t_6;
18480 
18481  /* "View.MemoryView":1160
18482  * else:
18483  * for i in range(dst_extent):
18484  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18485  * src_data += src_stride
18486  * dst_data += dst_stride
18487  */
18488  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18489 
18490  /* "View.MemoryView":1161
18491  * for i in range(dst_extent):
18492  * memcpy(dst_data, src_data, itemsize)
18493  * src_data += src_stride # <<<<<<<<<<<<<<
18494  * dst_data += dst_stride
18495  * else:
18496  */
18497  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18498 
18499  /* "View.MemoryView":1162
18500  * memcpy(dst_data, src_data, itemsize)
18501  * src_data += src_stride
18502  * dst_data += dst_stride # <<<<<<<<<<<<<<
18503  * else:
18504  * for i in range(dst_extent):
18505  */
18506  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18507  }
18508  }
18509  __pyx_L4:;
18510 
18511  /* "View.MemoryView":1154
18512  * cdef Py_ssize_t dst_stride = dst_strides[0]
18513  *
18514  * if ndim == 1: # <<<<<<<<<<<<<<
18515  * if (src_stride > 0 and dst_stride > 0 and
18516  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18517  */
18518  goto __pyx_L3;
18519  }
18520 
18521  /* "View.MemoryView":1164
18522  * dst_data += dst_stride
18523  * else:
18524  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18525  * _copy_strided_to_strided(src_data, src_strides + 1,
18526  * dst_data, dst_strides + 1,
18527  */
18528  /*else*/ {
18529  __pyx_t_4 = __pyx_v_dst_extent;
18530  __pyx_t_5 = __pyx_t_4;
18531  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18532  __pyx_v_i = __pyx_t_6;
18533 
18534  /* "View.MemoryView":1165
18535  * else:
18536  * for i in range(dst_extent):
18537  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18538  * dst_data, dst_strides + 1,
18539  * src_shape + 1, dst_shape + 1,
18540  */
18541  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18542 
18543  /* "View.MemoryView":1169
18544  * src_shape + 1, dst_shape + 1,
18545  * ndim - 1, itemsize)
18546  * src_data += src_stride # <<<<<<<<<<<<<<
18547  * dst_data += dst_stride
18548  *
18549  */
18550  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18551 
18552  /* "View.MemoryView":1170
18553  * ndim - 1, itemsize)
18554  * src_data += src_stride
18555  * dst_data += dst_stride # <<<<<<<<<<<<<<
18556  *
18557  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18558  */
18559  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18560  }
18561  }
18562  __pyx_L3:;
18563 
18564  /* "View.MemoryView":1142
18565  *
18566  * @cython.cdivision(True)
18567  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18568  * char *dst_data, Py_ssize_t *dst_strides,
18569  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18570  */
18571 
18572  /* function exit code */
18573 }
18574 
18575 /* "View.MemoryView":1172
18576  * dst_data += dst_stride
18577  *
18578  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18579  * __Pyx_memviewslice *dst,
18580  * int ndim, size_t itemsize) nogil:
18581  */
18582 
18583 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18584  __Pyx_TraceDeclarations
18585  int __pyx_lineno = 0;
18586  const char *__pyx_filename = NULL;
18587  int __pyx_clineno = 0;
18588  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
18589 
18590  /* "View.MemoryView":1175
18591  * __Pyx_memviewslice *dst,
18592  * int ndim, size_t itemsize) nogil:
18593  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18594  * src.shape, dst.shape, ndim, itemsize)
18595  *
18596  */
18597  __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
18598  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18599 
18600  /* "View.MemoryView":1172
18601  * dst_data += dst_stride
18602  *
18603  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18604  * __Pyx_memviewslice *dst,
18605  * int ndim, size_t itemsize) nogil:
18606  */
18607 
18608  /* function exit code */
18609  goto __pyx_L0;
18610  __pyx_L1_error:;
18611  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18612  __pyx_L0:;
18613  __Pyx_TraceReturn(Py_None, 1);
18614 }
18615 
18616 /* "View.MemoryView":1179
18617  *
18618  * @cname('__pyx_memoryview_slice_get_size')
18619  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18620  * "Return the size of the memory occupied by the slice in number of bytes"
18621  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18622  */
18623 
18624 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18625  Py_ssize_t __pyx_v_shape;
18626  Py_ssize_t __pyx_v_size;
18627  Py_ssize_t __pyx_r;
18628  __Pyx_TraceDeclarations
18629  Py_ssize_t __pyx_t_1;
18630  Py_ssize_t *__pyx_t_2;
18631  Py_ssize_t *__pyx_t_3;
18632  Py_ssize_t *__pyx_t_4;
18633  int __pyx_lineno = 0;
18634  const char *__pyx_filename = NULL;
18635  int __pyx_clineno = 0;
18636  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
18637 
18638  /* "View.MemoryView":1181
18639  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18640  * "Return the size of the memory occupied by the slice in number of bytes"
18641  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18642  *
18643  * for shape in src.shape[:ndim]:
18644  */
18645  __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18646  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18647  __pyx_v_size = __pyx_t_1;
18648 
18649  /* "View.MemoryView":1183
18650  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18651  *
18652  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18653  * size *= shape
18654  *
18655  */
18656  __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
18657  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18658  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18659  __pyx_t_2 = __pyx_t_4;
18660  __pyx_v_shape = (__pyx_t_2[0]);
18661 
18662  /* "View.MemoryView":1184
18663  *
18664  * for shape in src.shape[:ndim]:
18665  * size *= shape # <<<<<<<<<<<<<<
18666  *
18667  * return size
18668  */
18669  __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18670  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18671  }
18672 
18673  /* "View.MemoryView":1186
18674  * size *= shape
18675  *
18676  * return size # <<<<<<<<<<<<<<
18677  *
18678  * @cname('__pyx_fill_contig_strides_array')
18679  */
18680  __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
18681  __pyx_r = __pyx_v_size;
18682  goto __pyx_L0;
18683 
18684  /* "View.MemoryView":1179
18685  *
18686  * @cname('__pyx_memoryview_slice_get_size')
18687  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18688  * "Return the size of the memory occupied by the slice in number of bytes"
18689  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18690  */
18691 
18692  /* function exit code */
18693  __pyx_L1_error:;
18694  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18695  __pyx_r = 0;
18696  __pyx_L0:;
18697  __Pyx_TraceReturn(Py_None, 1);
18698  return __pyx_r;
18699 }
18700 
18701 /* "View.MemoryView":1189
18702  *
18703  * @cname('__pyx_fill_contig_strides_array')
18704  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18705  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18706  * int ndim, char order) nogil:
18707  */
18708 
18709 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18710  int __pyx_v_idx;
18711  Py_ssize_t __pyx_r;
18712  __Pyx_TraceDeclarations
18713  int __pyx_t_1;
18714  int __pyx_t_2;
18715  int __pyx_t_3;
18716  int __pyx_t_4;
18717  int __pyx_lineno = 0;
18718  const char *__pyx_filename = NULL;
18719  int __pyx_clineno = 0;
18720  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
18721 
18722  /* "View.MemoryView":1198
18723  * cdef int idx
18724  *
18725  * if order == 'F': # <<<<<<<<<<<<<<
18726  * for idx in range(ndim):
18727  * strides[idx] = stride
18728  */
18729  __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18730  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18731  if (__pyx_t_1) {
18732 
18733  /* "View.MemoryView":1199
18734  *
18735  * if order == 'F':
18736  * for idx in range(ndim): # <<<<<<<<<<<<<<
18737  * strides[idx] = stride
18738  * stride *= shape[idx]
18739  */
18740  __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18741  __pyx_t_2 = __pyx_v_ndim;
18742  __pyx_t_3 = __pyx_t_2;
18743  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18744  __pyx_v_idx = __pyx_t_4;
18745 
18746  /* "View.MemoryView":1200
18747  * if order == 'F':
18748  * for idx in range(ndim):
18749  * strides[idx] = stride # <<<<<<<<<<<<<<
18750  * stride *= shape[idx]
18751  * else:
18752  */
18753  __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
18754  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18755 
18756  /* "View.MemoryView":1201
18757  * for idx in range(ndim):
18758  * strides[idx] = stride
18759  * stride *= shape[idx] # <<<<<<<<<<<<<<
18760  * else:
18761  * for idx in range(ndim - 1, -1, -1):
18762  */
18763  __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18764  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18765  }
18766 
18767  /* "View.MemoryView":1198
18768  * cdef int idx
18769  *
18770  * if order == 'F': # <<<<<<<<<<<<<<
18771  * for idx in range(ndim):
18772  * strides[idx] = stride
18773  */
18774  goto __pyx_L3;
18775  }
18776 
18777  /* "View.MemoryView":1203
18778  * stride *= shape[idx]
18779  * else:
18780  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18781  * strides[idx] = stride
18782  * stride *= shape[idx]
18783  */
18784  __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18785  /*else*/ {
18786  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18787  __pyx_v_idx = __pyx_t_2;
18788 
18789  /* "View.MemoryView":1204
18790  * else:
18791  * for idx in range(ndim - 1, -1, -1):
18792  * strides[idx] = stride # <<<<<<<<<<<<<<
18793  * stride *= shape[idx]
18794  *
18795  */
18796  __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
18797  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18798 
18799  /* "View.MemoryView":1205
18800  * for idx in range(ndim - 1, -1, -1):
18801  * strides[idx] = stride
18802  * stride *= shape[idx] # <<<<<<<<<<<<<<
18803  *
18804  * return stride
18805  */
18806  __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18807  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18808  }
18809  }
18810  __pyx_L3:;
18811 
18812  /* "View.MemoryView":1207
18813  * stride *= shape[idx]
18814  *
18815  * return stride # <<<<<<<<<<<<<<
18816  *
18817  * @cname('__pyx_memoryview_copy_data_to_temp')
18818  */
18819  __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
18820  __pyx_r = __pyx_v_stride;
18821  goto __pyx_L0;
18822 
18823  /* "View.MemoryView":1189
18824  *
18825  * @cname('__pyx_fill_contig_strides_array')
18826  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18827  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18828  * int ndim, char order) nogil:
18829  */
18830 
18831  /* function exit code */
18832  __pyx_L1_error:;
18833  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18834  __pyx_r = 0;
18835  __pyx_L0:;
18836  __Pyx_TraceReturn(Py_None, 1);
18837  return __pyx_r;
18838 }
18839 
18840 /* "View.MemoryView":1210
18841  *
18842  * @cname('__pyx_memoryview_copy_data_to_temp')
18843  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18844  * __Pyx_memviewslice *tmpslice,
18845  * char order,
18846  */
18847 
18848 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18849  int __pyx_v_i;
18850  void *__pyx_v_result;
18851  size_t __pyx_v_itemsize;
18852  size_t __pyx_v_size;
18853  void *__pyx_r;
18854  __Pyx_TraceDeclarations
18855  Py_ssize_t __pyx_t_1;
18856  int __pyx_t_2;
18857  int __pyx_t_3;
18858  struct __pyx_memoryview_obj *__pyx_t_4;
18859  int __pyx_t_5;
18860  int __pyx_t_6;
18861  int __pyx_lineno = 0;
18862  const char *__pyx_filename = NULL;
18863  int __pyx_clineno = 0;
18864  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
18865 
18866  /* "View.MemoryView":1221
18867  * cdef void *result
18868  *
18869  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18870  * cdef size_t size = slice_get_size(src, ndim)
18871  *
18872  */
18873  __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
18874  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18875  __pyx_v_itemsize = __pyx_t_1;
18876 
18877  /* "View.MemoryView":1222
18878  *
18879  * cdef size_t itemsize = src.memview.view.itemsize
18880  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18881  *
18882  * result = malloc(size)
18883  */
18884  __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18885  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18886 
18887  /* "View.MemoryView":1224
18888  * cdef size_t size = slice_get_size(src, ndim)
18889  *
18890  * result = malloc(size) # <<<<<<<<<<<<<<
18891  * if not result:
18892  * _err(MemoryError, NULL)
18893  */
18894  __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18895  __pyx_v_result = malloc(__pyx_v_size);
18896 
18897  /* "View.MemoryView":1225
18898  *
18899  * result = malloc(size)
18900  * if not result: # <<<<<<<<<<<<<<
18901  * _err(MemoryError, NULL)
18902  *
18903  */
18904  __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
18905  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18906  if (__pyx_t_2) {
18907 
18908  /* "View.MemoryView":1226
18909  * result = malloc(size)
18910  * if not result:
18911  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18912  *
18913  *
18914  */
18915  __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
18916  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
18917 
18918  /* "View.MemoryView":1225
18919  *
18920  * result = malloc(size)
18921  * if not result: # <<<<<<<<<<<<<<
18922  * _err(MemoryError, NULL)
18923  *
18924  */
18925  }
18926 
18927  /* "View.MemoryView":1229
18928  *
18929  *
18930  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18931  * tmpslice.memview = src.memview
18932  * for i in range(ndim):
18933  */
18934  __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
18935  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18936 
18937  /* "View.MemoryView":1230
18938  *
18939  * tmpslice.data = <char *> result
18940  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18941  * for i in range(ndim):
18942  * tmpslice.shape[i] = src.shape[i]
18943  */
18944  __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
18945  __pyx_t_4 = __pyx_v_src->memview;
18946  __pyx_v_tmpslice->memview = __pyx_t_4;
18947 
18948  /* "View.MemoryView":1231
18949  * tmpslice.data = <char *> result
18950  * tmpslice.memview = src.memview
18951  * for i in range(ndim): # <<<<<<<<<<<<<<
18952  * tmpslice.shape[i] = src.shape[i]
18953  * tmpslice.suboffsets[i] = -1
18954  */
18955  __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
18956  __pyx_t_3 = __pyx_v_ndim;
18957  __pyx_t_5 = __pyx_t_3;
18958  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18959  __pyx_v_i = __pyx_t_6;
18960 
18961  /* "View.MemoryView":1232
18962  * tmpslice.memview = src.memview
18963  * for i in range(ndim):
18964  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18965  * tmpslice.suboffsets[i] = -1
18966  *
18967  */
18968  __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
18969  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18970 
18971  /* "View.MemoryView":1233
18972  * for i in range(ndim):
18973  * tmpslice.shape[i] = src.shape[i]
18974  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18975  *
18976  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18977  */
18978  __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
18979  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18980  }
18981 
18982  /* "View.MemoryView":1235
18983  * tmpslice.suboffsets[i] = -1
18984  *
18985  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18986  * ndim, order)
18987  *
18988  */
18989  __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
18990  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18991 
18992  /* "View.MemoryView":1239
18993  *
18994  *
18995  * for i in range(ndim): # <<<<<<<<<<<<<<
18996  * if tmpslice.shape[i] == 1:
18997  * tmpslice.strides[i] = 0
18998  */
18999  __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
19000  __pyx_t_3 = __pyx_v_ndim;
19001  __pyx_t_5 = __pyx_t_3;
19002  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19003  __pyx_v_i = __pyx_t_6;
19004 
19005  /* "View.MemoryView":1240
19006  *
19007  * for i in range(ndim):
19008  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19009  * tmpslice.strides[i] = 0
19010  *
19011  */
19012  __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
19013  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19014  if (__pyx_t_2) {
19015 
19016  /* "View.MemoryView":1241
19017  * for i in range(ndim):
19018  * if tmpslice.shape[i] == 1:
19019  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19020  *
19021  * if slice_is_contig(src[0], order, ndim):
19022  */
19023  __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
19024  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19025 
19026  /* "View.MemoryView":1240
19027  *
19028  * for i in range(ndim):
19029  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19030  * tmpslice.strides[i] = 0
19031  *
19032  */
19033  }
19034  }
19035 
19036  /* "View.MemoryView":1243
19037  * tmpslice.strides[i] = 0
19038  *
19039  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19040  * memcpy(result, src.data, size)
19041  * else:
19042  */
19043  __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
19044  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19045  if (__pyx_t_2) {
19046 
19047  /* "View.MemoryView":1244
19048  *
19049  * if slice_is_contig(src[0], order, ndim):
19050  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19051  * else:
19052  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19053  */
19054  __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
19055  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19056 
19057  /* "View.MemoryView":1243
19058  * tmpslice.strides[i] = 0
19059  *
19060  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19061  * memcpy(result, src.data, size)
19062  * else:
19063  */
19064  goto __pyx_L9;
19065  }
19066 
19067  /* "View.MemoryView":1246
19068  * memcpy(result, src.data, size)
19069  * else:
19070  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19071  *
19072  * return result
19073  */
19074  __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
19075  /*else*/ {
19076  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19077  }
19078  __pyx_L9:;
19079 
19080  /* "View.MemoryView":1248
19081  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19082  *
19083  * return result # <<<<<<<<<<<<<<
19084  *
19085  *
19086  */
19087  __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
19088  __pyx_r = __pyx_v_result;
19089  goto __pyx_L0;
19090 
19091  /* "View.MemoryView":1210
19092  *
19093  * @cname('__pyx_memoryview_copy_data_to_temp')
19094  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19095  * __Pyx_memviewslice *tmpslice,
19096  * char order,
19097  */
19098 
19099  /* function exit code */
19100  __pyx_L1_error:;
19101  {
19102  #ifdef WITH_THREAD
19103  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19104  #endif
19105  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19106  #ifdef WITH_THREAD
19107  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19108  #endif
19109  }
19110  __pyx_r = NULL;
19111  __pyx_L0:;
19112  __Pyx_TraceReturn(Py_None, 1);
19113  return __pyx_r;
19114 }
19115 
19116 /* "View.MemoryView":1253
19117  *
19118  * @cname('__pyx_memoryview_err_extents')
19119  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19120  * Py_ssize_t extent2) except -1 with gil:
19121  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19122  */
19123 
19124 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19125  int __pyx_r;
19126  __Pyx_TraceDeclarations
19127  __Pyx_RefNannyDeclarations
19128  PyObject *__pyx_t_1 = NULL;
19129  PyObject *__pyx_t_2 = NULL;
19130  PyObject *__pyx_t_3 = NULL;
19131  PyObject *__pyx_t_4 = NULL;
19132  int __pyx_lineno = 0;
19133  const char *__pyx_filename = NULL;
19134  int __pyx_clineno = 0;
19135  #ifdef WITH_THREAD
19136  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19137  #endif
19138  __Pyx_RefNannySetupContext("_err_extents", 0);
19139  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
19140 
19141  /* "View.MemoryView":1256
19142  * Py_ssize_t extent2) except -1 with gil:
19143  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19144  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19145  *
19146  * @cname('__pyx_memoryview_err_dim')
19147  */
19148  __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
19149  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
19150  __Pyx_GOTREF(__pyx_t_1);
19151  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
19152  __Pyx_GOTREF(__pyx_t_2);
19153  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
19154  __Pyx_GOTREF(__pyx_t_3);
19155  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
19156  __Pyx_GOTREF(__pyx_t_4);
19157  __Pyx_GIVEREF(__pyx_t_1);
19158  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19159  __Pyx_GIVEREF(__pyx_t_2);
19160  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19161  __Pyx_GIVEREF(__pyx_t_3);
19162  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19163  __pyx_t_1 = 0;
19164  __pyx_t_2 = 0;
19165  __pyx_t_3 = 0;
19166 
19167  /* "View.MemoryView":1255
19168  * cdef int _err_extents(int i, Py_ssize_t extent1,
19169  * Py_ssize_t extent2) except -1 with gil:
19170  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19171  * (i, extent1, extent2))
19172  *
19173  */
19174  __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
19175  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
19176  __Pyx_GOTREF(__pyx_t_3);
19177  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19178  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
19179  __Pyx_GOTREF(__pyx_t_4);
19180  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19181  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19182  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19183  __PYX_ERR(1, 1255, __pyx_L1_error)
19184 
19185  /* "View.MemoryView":1253
19186  *
19187  * @cname('__pyx_memoryview_err_extents')
19188  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19189  * Py_ssize_t extent2) except -1 with gil:
19190  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19191  */
19192 
19193  /* function exit code */
19194  __pyx_L1_error:;
19195  __Pyx_XDECREF(__pyx_t_1);
19196  __Pyx_XDECREF(__pyx_t_2);
19197  __Pyx_XDECREF(__pyx_t_3);
19198  __Pyx_XDECREF(__pyx_t_4);
19199  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19200  __pyx_r = -1;
19201  __Pyx_TraceReturn(Py_None, 0);
19202  __Pyx_RefNannyFinishContext();
19203  #ifdef WITH_THREAD
19204  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19205  #endif
19206  return __pyx_r;
19207 }
19208 
19209 /* "View.MemoryView":1259
19210  *
19211  * @cname('__pyx_memoryview_err_dim')
19212  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19213  * raise error(msg.decode('ascii') % dim)
19214  *
19215  */
19216 
19217 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19218  int __pyx_r;
19219  __Pyx_TraceDeclarations
19220  __Pyx_RefNannyDeclarations
19221  PyObject *__pyx_t_1 = NULL;
19222  PyObject *__pyx_t_2 = NULL;
19223  PyObject *__pyx_t_3 = NULL;
19224  PyObject *__pyx_t_4 = NULL;
19225  int __pyx_lineno = 0;
19226  const char *__pyx_filename = NULL;
19227  int __pyx_clineno = 0;
19228  #ifdef WITH_THREAD
19229  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19230  #endif
19231  __Pyx_RefNannySetupContext("_err_dim", 0);
19232  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
19233  __Pyx_INCREF(__pyx_v_error);
19234 
19235  /* "View.MemoryView":1260
19236  * @cname('__pyx_memoryview_err_dim')
19237  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19238  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19239  *
19240  * @cname('__pyx_memoryview_err')
19241  */
19242  __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
19243  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
19244  __Pyx_GOTREF(__pyx_t_2);
19245  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
19246  __Pyx_GOTREF(__pyx_t_3);
19247  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
19248  __Pyx_GOTREF(__pyx_t_4);
19249  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19250  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19251  __Pyx_INCREF(__pyx_v_error);
19252  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19253  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19254  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19255  if (likely(__pyx_t_2)) {
19256  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19257  __Pyx_INCREF(__pyx_t_2);
19258  __Pyx_INCREF(function);
19259  __Pyx_DECREF_SET(__pyx_t_3, function);
19260  }
19261  }
19262  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19263  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19264  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19265  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
19266  __Pyx_GOTREF(__pyx_t_1);
19267  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19268  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19269  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19270  __PYX_ERR(1, 1260, __pyx_L1_error)
19271 
19272  /* "View.MemoryView":1259
19273  *
19274  * @cname('__pyx_memoryview_err_dim')
19275  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19276  * raise error(msg.decode('ascii') % dim)
19277  *
19278  */
19279 
19280  /* function exit code */
19281  __pyx_L1_error:;
19282  __Pyx_XDECREF(__pyx_t_1);
19283  __Pyx_XDECREF(__pyx_t_2);
19284  __Pyx_XDECREF(__pyx_t_3);
19285  __Pyx_XDECREF(__pyx_t_4);
19286  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19287  __pyx_r = -1;
19288  __Pyx_XDECREF(__pyx_v_error);
19289  __Pyx_TraceReturn(Py_None, 0);
19290  __Pyx_RefNannyFinishContext();
19291  #ifdef WITH_THREAD
19292  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19293  #endif
19294  return __pyx_r;
19295 }
19296 
19297 /* "View.MemoryView":1263
19298  *
19299  * @cname('__pyx_memoryview_err')
19300  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19301  * if msg != NULL:
19302  * raise error(msg.decode('ascii'))
19303  */
19304 
19305 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19306  int __pyx_r;
19307  __Pyx_TraceDeclarations
19308  __Pyx_RefNannyDeclarations
19309  int __pyx_t_1;
19310  PyObject *__pyx_t_2 = NULL;
19311  PyObject *__pyx_t_3 = NULL;
19312  PyObject *__pyx_t_4 = NULL;
19313  PyObject *__pyx_t_5 = NULL;
19314  int __pyx_lineno = 0;
19315  const char *__pyx_filename = NULL;
19316  int __pyx_clineno = 0;
19317  #ifdef WITH_THREAD
19318  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19319  #endif
19320  __Pyx_RefNannySetupContext("_err", 0);
19321  __Pyx_TraceCall("_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
19322  __Pyx_INCREF(__pyx_v_error);
19323 
19324  /* "View.MemoryView":1264
19325  * @cname('__pyx_memoryview_err')
19326  * cdef int _err(object error, char *msg) except -1 with gil:
19327  * if msg != NULL: # <<<<<<<<<<<<<<
19328  * raise error(msg.decode('ascii'))
19329  * else:
19330  */
19331  __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
19332  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19333  if (unlikely(__pyx_t_1)) {
19334 
19335  /* "View.MemoryView":1265
19336  * cdef int _err(object error, char *msg) except -1 with gil:
19337  * if msg != NULL:
19338  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19339  * else:
19340  * raise error
19341  */
19342  __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
19343  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
19344  __Pyx_GOTREF(__pyx_t_3);
19345  __Pyx_INCREF(__pyx_v_error);
19346  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19347  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19348  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19349  if (likely(__pyx_t_5)) {
19350  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19351  __Pyx_INCREF(__pyx_t_5);
19352  __Pyx_INCREF(function);
19353  __Pyx_DECREF_SET(__pyx_t_4, function);
19354  }
19355  }
19356  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19357  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19358  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19359  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
19360  __Pyx_GOTREF(__pyx_t_2);
19361  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19362  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19363  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19364  __PYX_ERR(1, 1265, __pyx_L1_error)
19365 
19366  /* "View.MemoryView":1264
19367  * @cname('__pyx_memoryview_err')
19368  * cdef int _err(object error, char *msg) except -1 with gil:
19369  * if msg != NULL: # <<<<<<<<<<<<<<
19370  * raise error(msg.decode('ascii'))
19371  * else:
19372  */
19373  }
19374 
19375  /* "View.MemoryView":1267
19376  * raise error(msg.decode('ascii'))
19377  * else:
19378  * raise error # <<<<<<<<<<<<<<
19379  *
19380  * @cname('__pyx_memoryview_copy_contents')
19381  */
19382  __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
19383  /*else*/ {
19384  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19385  __PYX_ERR(1, 1267, __pyx_L1_error)
19386  }
19387 
19388  /* "View.MemoryView":1263
19389  *
19390  * @cname('__pyx_memoryview_err')
19391  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19392  * if msg != NULL:
19393  * raise error(msg.decode('ascii'))
19394  */
19395 
19396  /* function exit code */
19397  __pyx_L1_error:;
19398  __Pyx_XDECREF(__pyx_t_2);
19399  __Pyx_XDECREF(__pyx_t_3);
19400  __Pyx_XDECREF(__pyx_t_4);
19401  __Pyx_XDECREF(__pyx_t_5);
19402  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19403  __pyx_r = -1;
19404  __Pyx_XDECREF(__pyx_v_error);
19405  __Pyx_TraceReturn(Py_None, 0);
19406  __Pyx_RefNannyFinishContext();
19407  #ifdef WITH_THREAD
19408  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19409  #endif
19410  return __pyx_r;
19411 }
19412 
19413 /* "View.MemoryView":1270
19414  *
19415  * @cname('__pyx_memoryview_copy_contents')
19416  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19417  * __Pyx_memviewslice dst,
19418  * int src_ndim, int dst_ndim,
19419  */
19420 
19421 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19422  void *__pyx_v_tmpdata;
19423  size_t __pyx_v_itemsize;
19424  int __pyx_v_i;
19425  char __pyx_v_order;
19426  int __pyx_v_broadcasting;
19427  int __pyx_v_direct_copy;
19428  __Pyx_memviewslice __pyx_v_tmp;
19429  int __pyx_v_ndim;
19430  int __pyx_r;
19431  __Pyx_TraceDeclarations
19432  Py_ssize_t __pyx_t_1;
19433  int __pyx_t_2;
19434  int __pyx_t_3;
19435  int __pyx_t_4;
19436  int __pyx_t_5;
19437  int __pyx_t_6;
19438  void *__pyx_t_7;
19439  int __pyx_t_8;
19440  int __pyx_lineno = 0;
19441  const char *__pyx_filename = NULL;
19442  int __pyx_clineno = 0;
19443  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
19444 
19445  /* "View.MemoryView":1278
19446  * Check for overlapping memory and verify the shapes.
19447  * """
19448  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19449  * cdef size_t itemsize = src.memview.view.itemsize
19450  * cdef int i
19451  */
19452  __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
19453  __pyx_v_tmpdata = NULL;
19454 
19455  /* "View.MemoryView":1279
19456  * """
19457  * cdef void *tmpdata = NULL
19458  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19459  * cdef int i
19460  * cdef char order = get_best_order(&src, src_ndim)
19461  */
19462  __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
19463  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19464  __pyx_v_itemsize = __pyx_t_1;
19465 
19466  /* "View.MemoryView":1281
19467  * cdef size_t itemsize = src.memview.view.itemsize
19468  * cdef int i
19469  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19470  * cdef bint broadcasting = False
19471  * cdef bint direct_copy = False
19472  */
19473  __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
19474  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19475 
19476  /* "View.MemoryView":1282
19477  * cdef int i
19478  * cdef char order = get_best_order(&src, src_ndim)
19479  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19480  * cdef bint direct_copy = False
19481  * cdef __Pyx_memviewslice tmp
19482  */
19483  __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
19484  __pyx_v_broadcasting = 0;
19485 
19486  /* "View.MemoryView":1283
19487  * cdef char order = get_best_order(&src, src_ndim)
19488  * cdef bint broadcasting = False
19489  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19490  * cdef __Pyx_memviewslice tmp
19491  *
19492  */
19493  __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
19494  __pyx_v_direct_copy = 0;
19495 
19496  /* "View.MemoryView":1286
19497  * cdef __Pyx_memviewslice tmp
19498  *
19499  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19500  * broadcast_leading(&src, src_ndim, dst_ndim)
19501  * elif dst_ndim < src_ndim:
19502  */
19503  __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
19504  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19505  if (__pyx_t_2) {
19506 
19507  /* "View.MemoryView":1287
19508  *
19509  * if src_ndim < dst_ndim:
19510  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19511  * elif dst_ndim < src_ndim:
19512  * broadcast_leading(&dst, dst_ndim, src_ndim)
19513  */
19514  __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
19515  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19516 
19517  /* "View.MemoryView":1286
19518  * cdef __Pyx_memviewslice tmp
19519  *
19520  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19521  * broadcast_leading(&src, src_ndim, dst_ndim)
19522  * elif dst_ndim < src_ndim:
19523  */
19524  goto __pyx_L3;
19525  }
19526 
19527  /* "View.MemoryView":1288
19528  * if src_ndim < dst_ndim:
19529  * broadcast_leading(&src, src_ndim, dst_ndim)
19530  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19531  * broadcast_leading(&dst, dst_ndim, src_ndim)
19532  *
19533  */
19534  __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
19535  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19536  if (__pyx_t_2) {
19537 
19538  /* "View.MemoryView":1289
19539  * broadcast_leading(&src, src_ndim, dst_ndim)
19540  * elif dst_ndim < src_ndim:
19541  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19542  *
19543  * cdef int ndim = max(src_ndim, dst_ndim)
19544  */
19545  __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
19546  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19547 
19548  /* "View.MemoryView":1288
19549  * if src_ndim < dst_ndim:
19550  * broadcast_leading(&src, src_ndim, dst_ndim)
19551  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19552  * broadcast_leading(&dst, dst_ndim, src_ndim)
19553  *
19554  */
19555  }
19556  __pyx_L3:;
19557 
19558  /* "View.MemoryView":1291
19559  * broadcast_leading(&dst, dst_ndim, src_ndim)
19560  *
19561  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19562  *
19563  * for i in range(ndim):
19564  */
19565  __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
19566  __pyx_t_3 = __pyx_v_dst_ndim;
19567  __pyx_t_4 = __pyx_v_src_ndim;
19568  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19569  __pyx_t_5 = __pyx_t_3;
19570  } else {
19571  __pyx_t_5 = __pyx_t_4;
19572  }
19573  __pyx_v_ndim = __pyx_t_5;
19574 
19575  /* "View.MemoryView":1293
19576  * cdef int ndim = max(src_ndim, dst_ndim)
19577  *
19578  * for i in range(ndim): # <<<<<<<<<<<<<<
19579  * if src.shape[i] != dst.shape[i]:
19580  * if src.shape[i] == 1:
19581  */
19582  __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
19583  __pyx_t_5 = __pyx_v_ndim;
19584  __pyx_t_3 = __pyx_t_5;
19585  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19586  __pyx_v_i = __pyx_t_4;
19587 
19588  /* "View.MemoryView":1294
19589  *
19590  * for i in range(ndim):
19591  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19592  * if src.shape[i] == 1:
19593  * broadcasting = True
19594  */
19595  __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
19596  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19597  if (__pyx_t_2) {
19598 
19599  /* "View.MemoryView":1295
19600  * for i in range(ndim):
19601  * if src.shape[i] != dst.shape[i]:
19602  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19603  * broadcasting = True
19604  * src.strides[i] = 0
19605  */
19606  __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19607  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19608  if (__pyx_t_2) {
19609 
19610  /* "View.MemoryView":1296
19611  * if src.shape[i] != dst.shape[i]:
19612  * if src.shape[i] == 1:
19613  * broadcasting = True # <<<<<<<<<<<<<<
19614  * src.strides[i] = 0
19615  * else:
19616  */
19617  __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
19618  __pyx_v_broadcasting = 1;
19619 
19620  /* "View.MemoryView":1297
19621  * if src.shape[i] == 1:
19622  * broadcasting = True
19623  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19624  * else:
19625  * _err_extents(i, dst.shape[i], src.shape[i])
19626  */
19627  __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19628  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19629 
19630  /* "View.MemoryView":1295
19631  * for i in range(ndim):
19632  * if src.shape[i] != dst.shape[i]:
19633  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19634  * broadcasting = True
19635  * src.strides[i] = 0
19636  */
19637  goto __pyx_L7;
19638  }
19639 
19640  /* "View.MemoryView":1299
19641  * src.strides[i] = 0
19642  * else:
19643  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19644  *
19645  * if src.suboffsets[i] >= 0:
19646  */
19647  __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19648  /*else*/ {
19649  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
19650  }
19651  __pyx_L7:;
19652 
19653  /* "View.MemoryView":1294
19654  *
19655  * for i in range(ndim):
19656  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19657  * if src.shape[i] == 1:
19658  * broadcasting = True
19659  */
19660  }
19661 
19662  /* "View.MemoryView":1301
19663  * _err_extents(i, dst.shape[i], src.shape[i])
19664  *
19665  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19666  * _err_dim(ValueError, "Dimension %d is not direct", i)
19667  *
19668  */
19669  __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
19670  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19671  if (__pyx_t_2) {
19672 
19673  /* "View.MemoryView":1302
19674  *
19675  * if src.suboffsets[i] >= 0:
19676  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19677  *
19678  * if slices_overlap(&src, &dst, ndim, itemsize):
19679  */
19680  __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19681  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
19682 
19683  /* "View.MemoryView":1301
19684  * _err_extents(i, dst.shape[i], src.shape[i])
19685  *
19686  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19687  * _err_dim(ValueError, "Dimension %d is not direct", i)
19688  *
19689  */
19690  }
19691  }
19692 
19693  /* "View.MemoryView":1304
19694  * _err_dim(ValueError, "Dimension %d is not direct", i)
19695  *
19696  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19697  *
19698  * if not slice_is_contig(src, order, ndim):
19699  */
19700  __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19701  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19702  if (__pyx_t_2) {
19703 
19704  /* "View.MemoryView":1306
19705  * if slices_overlap(&src, &dst, ndim, itemsize):
19706  *
19707  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19708  * order = get_best_order(&dst, ndim)
19709  *
19710  */
19711  __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
19712  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19713  if (__pyx_t_2) {
19714 
19715  /* "View.MemoryView":1307
19716  *
19717  * if not slice_is_contig(src, order, ndim):
19718  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19719  *
19720  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19721  */
19722  __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19723  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19724 
19725  /* "View.MemoryView":1306
19726  * if slices_overlap(&src, &dst, ndim, itemsize):
19727  *
19728  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19729  * order = get_best_order(&dst, ndim)
19730  *
19731  */
19732  }
19733 
19734  /* "View.MemoryView":1309
19735  * order = get_best_order(&dst, ndim)
19736  *
19737  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19738  * src = tmp
19739  *
19740  */
19741  __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
19742  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
19743  __pyx_v_tmpdata = __pyx_t_7;
19744 
19745  /* "View.MemoryView":1310
19746  *
19747  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19748  * src = tmp # <<<<<<<<<<<<<<
19749  *
19750  * if not broadcasting:
19751  */
19752  __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19753  __pyx_v_src = __pyx_v_tmp;
19754 
19755  /* "View.MemoryView":1304
19756  * _err_dim(ValueError, "Dimension %d is not direct", i)
19757  *
19758  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19759  *
19760  * if not slice_is_contig(src, order, ndim):
19761  */
19762  }
19763 
19764  /* "View.MemoryView":1312
19765  * src = tmp
19766  *
19767  * if not broadcasting: # <<<<<<<<<<<<<<
19768  *
19769  *
19770  */
19771  __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
19772  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19773  if (__pyx_t_2) {
19774 
19775  /* "View.MemoryView":1315
19776  *
19777  *
19778  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19779  * direct_copy = slice_is_contig(dst, 'C', ndim)
19780  * elif slice_is_contig(src, 'F', ndim):
19781  */
19782  __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19783  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19784  if (__pyx_t_2) {
19785 
19786  /* "View.MemoryView":1316
19787  *
19788  * if slice_is_contig(src, 'C', ndim):
19789  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19790  * elif slice_is_contig(src, 'F', ndim):
19791  * direct_copy = slice_is_contig(dst, 'F', ndim)
19792  */
19793  __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19794  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19795 
19796  /* "View.MemoryView":1315
19797  *
19798  *
19799  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19800  * direct_copy = slice_is_contig(dst, 'C', ndim)
19801  * elif slice_is_contig(src, 'F', ndim):
19802  */
19803  goto __pyx_L12;
19804  }
19805 
19806  /* "View.MemoryView":1317
19807  * if slice_is_contig(src, 'C', ndim):
19808  * direct_copy = slice_is_contig(dst, 'C', ndim)
19809  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19810  * direct_copy = slice_is_contig(dst, 'F', ndim)
19811  *
19812  */
19813  __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
19814  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19815  if (__pyx_t_2) {
19816 
19817  /* "View.MemoryView":1318
19818  * direct_copy = slice_is_contig(dst, 'C', ndim)
19819  * elif slice_is_contig(src, 'F', ndim):
19820  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19821  *
19822  * if direct_copy:
19823  */
19824  __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19825  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19826 
19827  /* "View.MemoryView":1317
19828  * if slice_is_contig(src, 'C', ndim):
19829  * direct_copy = slice_is_contig(dst, 'C', ndim)
19830  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19831  * direct_copy = slice_is_contig(dst, 'F', ndim)
19832  *
19833  */
19834  }
19835  __pyx_L12:;
19836 
19837  /* "View.MemoryView":1320
19838  * direct_copy = slice_is_contig(dst, 'F', ndim)
19839  *
19840  * if direct_copy: # <<<<<<<<<<<<<<
19841  *
19842  * refcount_copying(&dst, dtype_is_object, ndim, False)
19843  */
19844  __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19845  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19846  if (__pyx_t_2) {
19847 
19848  /* "View.MemoryView":1322
19849  * if direct_copy:
19850  *
19851  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19852  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19853  * refcount_copying(&dst, dtype_is_object, ndim, True)
19854  */
19855  __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19856  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19857 
19858  /* "View.MemoryView":1323
19859  *
19860  * refcount_copying(&dst, dtype_is_object, ndim, False)
19861  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19862  * refcount_copying(&dst, dtype_is_object, ndim, True)
19863  * free(tmpdata)
19864  */
19865  __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19866  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19867 
19868  /* "View.MemoryView":1324
19869  * refcount_copying(&dst, dtype_is_object, ndim, False)
19870  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19871  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19872  * free(tmpdata)
19873  * return 0
19874  */
19875  __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19876  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19877 
19878  /* "View.MemoryView":1325
19879  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19880  * refcount_copying(&dst, dtype_is_object, ndim, True)
19881  * free(tmpdata) # <<<<<<<<<<<<<<
19882  * return 0
19883  *
19884  */
19885  __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
19886  free(__pyx_v_tmpdata);
19887 
19888  /* "View.MemoryView":1326
19889  * refcount_copying(&dst, dtype_is_object, ndim, True)
19890  * free(tmpdata)
19891  * return 0 # <<<<<<<<<<<<<<
19892  *
19893  * if order == 'F' == get_best_order(&dst, ndim):
19894  */
19895  __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19896  __pyx_r = 0;
19897  goto __pyx_L0;
19898 
19899  /* "View.MemoryView":1320
19900  * direct_copy = slice_is_contig(dst, 'F', ndim)
19901  *
19902  * if direct_copy: # <<<<<<<<<<<<<<
19903  *
19904  * refcount_copying(&dst, dtype_is_object, ndim, False)
19905  */
19906  }
19907 
19908  /* "View.MemoryView":1312
19909  * src = tmp
19910  *
19911  * if not broadcasting: # <<<<<<<<<<<<<<
19912  *
19913  *
19914  */
19915  }
19916 
19917  /* "View.MemoryView":1328
19918  * return 0
19919  *
19920  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19921  *
19922  *
19923  */
19924  __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
19925  __pyx_t_2 = (__pyx_v_order == 'F');
19926  if (__pyx_t_2) {
19927  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19928  }
19929  __pyx_t_8 = (__pyx_t_2 != 0);
19930  if (__pyx_t_8) {
19931 
19932  /* "View.MemoryView":1331
19933  *
19934  *
19935  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19936  * transpose_memslice(&dst)
19937  *
19938  */
19939  __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
19940  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
19941 
19942  /* "View.MemoryView":1332
19943  *
19944  * transpose_memslice(&src)
19945  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19946  *
19947  * refcount_copying(&dst, dtype_is_object, ndim, False)
19948  */
19949  __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
19950  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
19951 
19952  /* "View.MemoryView":1328
19953  * return 0
19954  *
19955  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19956  *
19957  *
19958  */
19959  }
19960 
19961  /* "View.MemoryView":1334
19962  * transpose_memslice(&dst)
19963  *
19964  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19965  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19966  * refcount_copying(&dst, dtype_is_object, ndim, True)
19967  */
19968  __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
19969  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19970 
19971  /* "View.MemoryView":1335
19972  *
19973  * refcount_copying(&dst, dtype_is_object, ndim, False)
19974  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19975  * refcount_copying(&dst, dtype_is_object, ndim, True)
19976  *
19977  */
19978  __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
19979  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19980 
19981  /* "View.MemoryView":1336
19982  * refcount_copying(&dst, dtype_is_object, ndim, False)
19983  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19984  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19985  *
19986  * free(tmpdata)
19987  */
19988  __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
19989  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19990 
19991  /* "View.MemoryView":1338
19992  * refcount_copying(&dst, dtype_is_object, ndim, True)
19993  *
19994  * free(tmpdata) # <<<<<<<<<<<<<<
19995  * return 0
19996  *
19997  */
19998  __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
19999  free(__pyx_v_tmpdata);
20000 
20001  /* "View.MemoryView":1339
20002  *
20003  * free(tmpdata)
20004  * return 0 # <<<<<<<<<<<<<<
20005  *
20006  * @cname('__pyx_memoryview_broadcast_leading')
20007  */
20008  __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
20009  __pyx_r = 0;
20010  goto __pyx_L0;
20011 
20012  /* "View.MemoryView":1270
20013  *
20014  * @cname('__pyx_memoryview_copy_contents')
20015  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20016  * __Pyx_memviewslice dst,
20017  * int src_ndim, int dst_ndim,
20018  */
20019 
20020  /* function exit code */
20021  __pyx_L1_error:;
20022  {
20023  #ifdef WITH_THREAD
20024  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20025  #endif
20026  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20027  #ifdef WITH_THREAD
20028  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20029  #endif
20030  }
20031  __pyx_r = -1;
20032  __pyx_L0:;
20033  __Pyx_TraceReturn(Py_None, 1);
20034  return __pyx_r;
20035 }
20036 
20037 /* "View.MemoryView":1342
20038  *
20039  * @cname('__pyx_memoryview_broadcast_leading')
20040  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20041  * int ndim,
20042  * int ndim_other) nogil:
20043  */
20044 
20045 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20046  int __pyx_v_i;
20047  int __pyx_v_offset;
20048  __Pyx_TraceDeclarations
20049  int __pyx_t_1;
20050  int __pyx_t_2;
20051  int __pyx_t_3;
20052  int __pyx_lineno = 0;
20053  const char *__pyx_filename = NULL;
20054  int __pyx_clineno = 0;
20055  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
20056 
20057  /* "View.MemoryView":1346
20058  * int ndim_other) nogil:
20059  * cdef int i
20060  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20061  *
20062  * for i in range(ndim - 1, -1, -1):
20063  */
20064  __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
20065  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20066 
20067  /* "View.MemoryView":1348
20068  * cdef int offset = ndim_other - ndim
20069  *
20070  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20071  * mslice.shape[i + offset] = mslice.shape[i]
20072  * mslice.strides[i + offset] = mslice.strides[i]
20073  */
20074  __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
20075  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20076  __pyx_v_i = __pyx_t_1;
20077 
20078  /* "View.MemoryView":1349
20079  *
20080  * for i in range(ndim - 1, -1, -1):
20081  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20082  * mslice.strides[i + offset] = mslice.strides[i]
20083  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20084  */
20085  __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
20086  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20087 
20088  /* "View.MemoryView":1350
20089  * for i in range(ndim - 1, -1, -1):
20090  * mslice.shape[i + offset] = mslice.shape[i]
20091  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20092  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20093  *
20094  */
20095  __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
20096  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20097 
20098  /* "View.MemoryView":1351
20099  * mslice.shape[i + offset] = mslice.shape[i]
20100  * mslice.strides[i + offset] = mslice.strides[i]
20101  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20102  *
20103  * for i in range(offset):
20104  */
20105  __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
20106  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20107  }
20108 
20109  /* "View.MemoryView":1353
20110  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20111  *
20112  * for i in range(offset): # <<<<<<<<<<<<<<
20113  * mslice.shape[i] = 1
20114  * mslice.strides[i] = mslice.strides[0]
20115  */
20116  __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
20117  __pyx_t_1 = __pyx_v_offset;
20118  __pyx_t_2 = __pyx_t_1;
20119  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20120  __pyx_v_i = __pyx_t_3;
20121 
20122  /* "View.MemoryView":1354
20123  *
20124  * for i in range(offset):
20125  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20126  * mslice.strides[i] = mslice.strides[0]
20127  * mslice.suboffsets[i] = -1
20128  */
20129  __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
20130  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20131 
20132  /* "View.MemoryView":1355
20133  * for i in range(offset):
20134  * mslice.shape[i] = 1
20135  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20136  * mslice.suboffsets[i] = -1
20137  *
20138  */
20139  __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
20140  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20141 
20142  /* "View.MemoryView":1356
20143  * mslice.shape[i] = 1
20144  * mslice.strides[i] = mslice.strides[0]
20145  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20146  *
20147  *
20148  */
20149  __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
20150  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20151  }
20152 
20153  /* "View.MemoryView":1342
20154  *
20155  * @cname('__pyx_memoryview_broadcast_leading')
20156  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20157  * int ndim,
20158  * int ndim_other) nogil:
20159  */
20160 
20161  /* function exit code */
20162  goto __pyx_L0;
20163  __pyx_L1_error:;
20164  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20165  __pyx_L0:;
20166  __Pyx_TraceReturn(Py_None, 1);
20167 }
20168 
20169 /* "View.MemoryView":1364
20170  *
20171  * @cname('__pyx_memoryview_refcount_copying')
20172  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20173  * int ndim, bint inc) nogil:
20174  *
20175  */
20176 
20177 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20178  __Pyx_TraceDeclarations
20179  int __pyx_t_1;
20180  int __pyx_lineno = 0;
20181  const char *__pyx_filename = NULL;
20182  int __pyx_clineno = 0;
20183  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
20184 
20185  /* "View.MemoryView":1368
20186  *
20187  *
20188  * if dtype_is_object: # <<<<<<<<<<<<<<
20189  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20190  * dst.strides, ndim, inc)
20191  */
20192  __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
20193  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20194  if (__pyx_t_1) {
20195 
20196  /* "View.MemoryView":1369
20197  *
20198  * if dtype_is_object:
20199  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20200  * dst.strides, ndim, inc)
20201  *
20202  */
20203  __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
20204  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20205 
20206  /* "View.MemoryView":1368
20207  *
20208  *
20209  * if dtype_is_object: # <<<<<<<<<<<<<<
20210  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20211  * dst.strides, ndim, inc)
20212  */
20213  }
20214 
20215  /* "View.MemoryView":1364
20216  *
20217  * @cname('__pyx_memoryview_refcount_copying')
20218  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20219  * int ndim, bint inc) nogil:
20220  *
20221  */
20222 
20223  /* function exit code */
20224  goto __pyx_L0;
20225  __pyx_L1_error:;
20226  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20227  __pyx_L0:;
20228  __Pyx_TraceReturn(Py_None, 1);
20229 }
20230 
20231 /* "View.MemoryView":1373
20232  *
20233  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20234  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20235  * Py_ssize_t *strides, int ndim,
20236  * bint inc) with gil:
20237  */
20238 
20239 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20240  __Pyx_TraceDeclarations
20241  __Pyx_RefNannyDeclarations
20242  int __pyx_lineno = 0;
20243  const char *__pyx_filename = NULL;
20244  int __pyx_clineno = 0;
20245  #ifdef WITH_THREAD
20246  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20247  #endif
20248  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20249  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
20250 
20251  /* "View.MemoryView":1376
20252  * Py_ssize_t *strides, int ndim,
20253  * bint inc) with gil:
20254  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20255  *
20256  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20257  */
20258  __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
20259  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20260 
20261  /* "View.MemoryView":1373
20262  *
20263  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20264  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20265  * Py_ssize_t *strides, int ndim,
20266  * bint inc) with gil:
20267  */
20268 
20269  /* function exit code */
20270  goto __pyx_L0;
20271  __pyx_L1_error:;
20272  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20273  __pyx_L0:;
20274  __Pyx_TraceReturn(Py_None, 0);
20275  __Pyx_RefNannyFinishContext();
20276  #ifdef WITH_THREAD
20277  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20278  #endif
20279 }
20280 
20281 /* "View.MemoryView":1379
20282  *
20283  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20284  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20285  * Py_ssize_t *strides, int ndim, bint inc):
20286  * cdef Py_ssize_t i
20287  */
20288 
20289 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20290  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20291  __Pyx_TraceDeclarations
20292  __Pyx_RefNannyDeclarations
20293  Py_ssize_t __pyx_t_1;
20294  Py_ssize_t __pyx_t_2;
20295  Py_ssize_t __pyx_t_3;
20296  int __pyx_t_4;
20297  int __pyx_lineno = 0;
20298  const char *__pyx_filename = NULL;
20299  int __pyx_clineno = 0;
20300  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20301  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
20302 
20303  /* "View.MemoryView":1383
20304  * cdef Py_ssize_t i
20305  *
20306  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20307  * if ndim == 1:
20308  * if inc:
20309  */
20310  __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
20311  __pyx_t_1 = (__pyx_v_shape[0]);
20312  __pyx_t_2 = __pyx_t_1;
20313  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20314  __pyx_v_i = __pyx_t_3;
20315 
20316  /* "View.MemoryView":1384
20317  *
20318  * for i in range(shape[0]):
20319  * if ndim == 1: # <<<<<<<<<<<<<<
20320  * if inc:
20321  * Py_INCREF((<PyObject **> data)[0])
20322  */
20323  __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
20324  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20325  if (__pyx_t_4) {
20326 
20327  /* "View.MemoryView":1385
20328  * for i in range(shape[0]):
20329  * if ndim == 1:
20330  * if inc: # <<<<<<<<<<<<<<
20331  * Py_INCREF((<PyObject **> data)[0])
20332  * else:
20333  */
20334  __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
20335  __pyx_t_4 = (__pyx_v_inc != 0);
20336  if (__pyx_t_4) {
20337 
20338  /* "View.MemoryView":1386
20339  * if ndim == 1:
20340  * if inc:
20341  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20342  * else:
20343  * Py_DECREF((<PyObject **> data)[0])
20344  */
20345  __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
20346  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20347 
20348  /* "View.MemoryView":1385
20349  * for i in range(shape[0]):
20350  * if ndim == 1:
20351  * if inc: # <<<<<<<<<<<<<<
20352  * Py_INCREF((<PyObject **> data)[0])
20353  * else:
20354  */
20355  goto __pyx_L6;
20356  }
20357 
20358  /* "View.MemoryView":1388
20359  * Py_INCREF((<PyObject **> data)[0])
20360  * else:
20361  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20362  * else:
20363  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20364  */
20365  __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
20366  /*else*/ {
20367  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20368  }
20369  __pyx_L6:;
20370 
20371  /* "View.MemoryView":1384
20372  *
20373  * for i in range(shape[0]):
20374  * if ndim == 1: # <<<<<<<<<<<<<<
20375  * if inc:
20376  * Py_INCREF((<PyObject **> data)[0])
20377  */
20378  goto __pyx_L5;
20379  }
20380 
20381  /* "View.MemoryView":1390
20382  * Py_DECREF((<PyObject **> data)[0])
20383  * else:
20384  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20385  * ndim - 1, inc)
20386  *
20387  */
20388  __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
20389  /*else*/ {
20390 
20391  /* "View.MemoryView":1391
20392  * else:
20393  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20394  * ndim - 1, inc) # <<<<<<<<<<<<<<
20395  *
20396  * data += strides[0]
20397  */
20398  __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
20399  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20400  }
20401  __pyx_L5:;
20402 
20403  /* "View.MemoryView":1393
20404  * ndim - 1, inc)
20405  *
20406  * data += strides[0] # <<<<<<<<<<<<<<
20407  *
20408  *
20409  */
20410  __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
20411  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20412  }
20413 
20414  /* "View.MemoryView":1379
20415  *
20416  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20417  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20418  * Py_ssize_t *strides, int ndim, bint inc):
20419  * cdef Py_ssize_t i
20420  */
20421 
20422  /* function exit code */
20423  goto __pyx_L0;
20424  __pyx_L1_error:;
20425  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20426  __pyx_L0:;
20427  __Pyx_TraceReturn(Py_None, 0);
20428  __Pyx_RefNannyFinishContext();
20429 }
20430 
20431 /* "View.MemoryView":1399
20432  *
20433  * @cname('__pyx_memoryview_slice_assign_scalar')
20434  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20435  * size_t itemsize, void *item,
20436  * bint dtype_is_object) nogil:
20437  */
20438 
20439 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20440  __Pyx_TraceDeclarations
20441  int __pyx_lineno = 0;
20442  const char *__pyx_filename = NULL;
20443  int __pyx_clineno = 0;
20444  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
20445 
20446  /* "View.MemoryView":1402
20447  * size_t itemsize, void *item,
20448  * bint dtype_is_object) nogil:
20449  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20450  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20451  * itemsize, item)
20452  */
20453  __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
20454  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20455 
20456  /* "View.MemoryView":1403
20457  * bint dtype_is_object) nogil:
20458  * refcount_copying(dst, dtype_is_object, ndim, False)
20459  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20460  * itemsize, item)
20461  * refcount_copying(dst, dtype_is_object, ndim, True)
20462  */
20463  __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
20464  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20465 
20466  /* "View.MemoryView":1405
20467  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20468  * itemsize, item)
20469  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20470  *
20471  *
20472  */
20473  __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
20474  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20475 
20476  /* "View.MemoryView":1399
20477  *
20478  * @cname('__pyx_memoryview_slice_assign_scalar')
20479  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20480  * size_t itemsize, void *item,
20481  * bint dtype_is_object) nogil:
20482  */
20483 
20484  /* function exit code */
20485  goto __pyx_L0;
20486  __pyx_L1_error:;
20487  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20488  __pyx_L0:;
20489  __Pyx_TraceReturn(Py_None, 1);
20490 }
20491 
20492 /* "View.MemoryView":1409
20493  *
20494  * @cname('__pyx_memoryview__slice_assign_scalar')
20495  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20496  * Py_ssize_t *strides, int ndim,
20497  * size_t itemsize, void *item) nogil:
20498  */
20499 
20500 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20501  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20502  Py_ssize_t __pyx_v_stride;
20503  Py_ssize_t __pyx_v_extent;
20504  __Pyx_TraceDeclarations
20505  int __pyx_t_1;
20506  Py_ssize_t __pyx_t_2;
20507  Py_ssize_t __pyx_t_3;
20508  Py_ssize_t __pyx_t_4;
20509  int __pyx_lineno = 0;
20510  const char *__pyx_filename = NULL;
20511  int __pyx_clineno = 0;
20512  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
20513 
20514  /* "View.MemoryView":1413
20515  * size_t itemsize, void *item) nogil:
20516  * cdef Py_ssize_t i
20517  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20518  * cdef Py_ssize_t extent = shape[0]
20519  *
20520  */
20521  __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
20522  __pyx_v_stride = (__pyx_v_strides[0]);
20523 
20524  /* "View.MemoryView":1414
20525  * cdef Py_ssize_t i
20526  * cdef Py_ssize_t stride = strides[0]
20527  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20528  *
20529  * if ndim == 1:
20530  */
20531  __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
20532  __pyx_v_extent = (__pyx_v_shape[0]);
20533 
20534  /* "View.MemoryView":1416
20535  * cdef Py_ssize_t extent = shape[0]
20536  *
20537  * if ndim == 1: # <<<<<<<<<<<<<<
20538  * for i in range(extent):
20539  * memcpy(data, item, itemsize)
20540  */
20541  __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
20542  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20543  if (__pyx_t_1) {
20544 
20545  /* "View.MemoryView":1417
20546  *
20547  * if ndim == 1:
20548  * for i in range(extent): # <<<<<<<<<<<<<<
20549  * memcpy(data, item, itemsize)
20550  * data += stride
20551  */
20552  __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
20553  __pyx_t_2 = __pyx_v_extent;
20554  __pyx_t_3 = __pyx_t_2;
20555  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20556  __pyx_v_i = __pyx_t_4;
20557 
20558  /* "View.MemoryView":1418
20559  * if ndim == 1:
20560  * for i in range(extent):
20561  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20562  * data += stride
20563  * else:
20564  */
20565  __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
20566  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20567 
20568  /* "View.MemoryView":1419
20569  * for i in range(extent):
20570  * memcpy(data, item, itemsize)
20571  * data += stride # <<<<<<<<<<<<<<
20572  * else:
20573  * for i in range(extent):
20574  */
20575  __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
20576  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20577  }
20578 
20579  /* "View.MemoryView":1416
20580  * cdef Py_ssize_t extent = shape[0]
20581  *
20582  * if ndim == 1: # <<<<<<<<<<<<<<
20583  * for i in range(extent):
20584  * memcpy(data, item, itemsize)
20585  */
20586  goto __pyx_L3;
20587  }
20588 
20589  /* "View.MemoryView":1421
20590  * data += stride
20591  * else:
20592  * for i in range(extent): # <<<<<<<<<<<<<<
20593  * _slice_assign_scalar(data, shape + 1, strides + 1,
20594  * ndim - 1, itemsize, item)
20595  */
20596  __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
20597  /*else*/ {
20598  __pyx_t_2 = __pyx_v_extent;
20599  __pyx_t_3 = __pyx_t_2;
20600  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20601  __pyx_v_i = __pyx_t_4;
20602 
20603  /* "View.MemoryView":1422
20604  * else:
20605  * for i in range(extent):
20606  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20607  * ndim - 1, itemsize, item)
20608  * data += stride
20609  */
20610  __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20611  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20612 
20613  /* "View.MemoryView":1424
20614  * _slice_assign_scalar(data, shape + 1, strides + 1,
20615  * ndim - 1, itemsize, item)
20616  * data += stride # <<<<<<<<<<<<<<
20617  *
20618  *
20619  */
20620  __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
20621  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20622  }
20623  }
20624  __pyx_L3:;
20625 
20626  /* "View.MemoryView":1409
20627  *
20628  * @cname('__pyx_memoryview__slice_assign_scalar')
20629  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20630  * Py_ssize_t *strides, int ndim,
20631  * size_t itemsize, void *item) nogil:
20632  */
20633 
20634  /* function exit code */
20635  goto __pyx_L0;
20636  __pyx_L1_error:;
20637  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20638  __pyx_L0:;
20639  __Pyx_TraceReturn(Py_None, 1);
20640 }
20641 
20642 /* "(tree fragment)":1
20643  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20644  * cdef object __pyx_PickleError
20645  * cdef object __pyx_result
20646  */
20647 
20648 /* Python wrapper */
20649 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20650 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20651 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20652  PyObject *__pyx_v___pyx_type = 0;
20653  long __pyx_v___pyx_checksum;
20654  PyObject *__pyx_v___pyx_state = 0;
20655  int __pyx_lineno = 0;
20656  const char *__pyx_filename = NULL;
20657  int __pyx_clineno = 0;
20658  PyObject *__pyx_r = 0;
20659  __Pyx_RefNannyDeclarations
20660  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20661  {
20662  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20663  PyObject* values[3] = {0,0,0};
20664  if (unlikely(__pyx_kwds)) {
20665  Py_ssize_t kw_args;
20666  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20667  switch (pos_args) {
20668  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20669  CYTHON_FALLTHROUGH;
20670  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20671  CYTHON_FALLTHROUGH;
20672  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20673  CYTHON_FALLTHROUGH;
20674  case 0: break;
20675  default: goto __pyx_L5_argtuple_error;
20676  }
20677  kw_args = PyDict_Size(__pyx_kwds);
20678  switch (pos_args) {
20679  case 0:
20680  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20681  else goto __pyx_L5_argtuple_error;
20682  CYTHON_FALLTHROUGH;
20683  case 1:
20684  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20685  else {
20686  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20687  }
20688  CYTHON_FALLTHROUGH;
20689  case 2:
20690  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20691  else {
20692  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20693  }
20694  }
20695  if (unlikely(kw_args > 0)) {
20696  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20697  }
20698  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20699  goto __pyx_L5_argtuple_error;
20700  } else {
20701  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20702  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20703  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20704  }
20705  __pyx_v___pyx_type = values[0];
20706  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20707  __pyx_v___pyx_state = values[2];
20708  }
20709  goto __pyx_L4_argument_unpacking_done;
20710  __pyx_L5_argtuple_error:;
20711  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20712  __pyx_L3_error:;
20713  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20714  __Pyx_RefNannyFinishContext();
20715  return NULL;
20716  __pyx_L4_argument_unpacking_done:;
20717  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20718 
20719  /* function exit code */
20720  __Pyx_RefNannyFinishContext();
20721  return __pyx_r;
20722 }
20723 
20724 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20725  PyObject *__pyx_v___pyx_PickleError = 0;
20726  PyObject *__pyx_v___pyx_result = 0;
20727  PyObject *__pyx_r = NULL;
20728  __Pyx_TraceDeclarations
20729  __Pyx_RefNannyDeclarations
20730  PyObject *__pyx_t_1 = NULL;
20731  int __pyx_t_2;
20732  int __pyx_t_3;
20733  PyObject *__pyx_t_4 = NULL;
20734  PyObject *__pyx_t_5 = NULL;
20735  PyObject *__pyx_t_6 = NULL;
20736  int __pyx_lineno = 0;
20737  const char *__pyx_filename = NULL;
20738  int __pyx_clineno = 0;
20739  __Pyx_TraceFrameInit(__pyx_codeobj__36)
20740  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20741  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20742 
20743  /* "(tree fragment)":4
20744  * cdef object __pyx_PickleError
20745  * cdef object __pyx_result
20746  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20747  * from pickle import PickleError as __pyx_PickleError
20748  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20749  */
20750  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20751  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20752  __Pyx_GOTREF(__pyx_t_1);
20753  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__37, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20754  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20755  __pyx_t_3 = (__pyx_t_2 != 0);
20756  if (__pyx_t_3) {
20757 
20758  /* "(tree fragment)":5
20759  * cdef object __pyx_result
20760  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20761  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20762  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20763  * __pyx_result = Enum.__new__(__pyx_type)
20764  */
20765  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20766  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20767  __Pyx_GOTREF(__pyx_t_1);
20768  __Pyx_INCREF(__pyx_n_s_PickleError);
20769  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20770  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20771  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20772  __Pyx_GOTREF(__pyx_t_4);
20773  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20774  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20775  __Pyx_GOTREF(__pyx_t_1);
20776  __Pyx_INCREF(__pyx_t_1);
20777  __pyx_v___pyx_PickleError = __pyx_t_1;
20778  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20779  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20780 
20781  /* "(tree fragment)":6
20782  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20783  * from pickle import PickleError as __pyx_PickleError
20784  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20785  * __pyx_result = Enum.__new__(__pyx_type)
20786  * if __pyx_state is not None:
20787  */
20788  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20789  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20790  __Pyx_GOTREF(__pyx_t_1);
20791  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20792  __Pyx_GOTREF(__pyx_t_5);
20793  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20794  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20795  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20796  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20797  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20798  if (likely(__pyx_t_6)) {
20799  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20800  __Pyx_INCREF(__pyx_t_6);
20801  __Pyx_INCREF(function);
20802  __Pyx_DECREF_SET(__pyx_t_1, function);
20803  }
20804  }
20805  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
20806  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20807  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20808  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20809  __Pyx_GOTREF(__pyx_t_4);
20810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20811  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20812  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20813  __PYX_ERR(1, 6, __pyx_L1_error)
20814 
20815  /* "(tree fragment)":4
20816  * cdef object __pyx_PickleError
20817  * cdef object __pyx_result
20818  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20819  * from pickle import PickleError as __pyx_PickleError
20820  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20821  */
20822  }
20823 
20824  /* "(tree fragment)":7
20825  * from pickle import PickleError as __pyx_PickleError
20826  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20827  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20828  * if __pyx_state is not None:
20829  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20830  */
20831  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20832  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20833  __Pyx_GOTREF(__pyx_t_1);
20834  __pyx_t_5 = NULL;
20835  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20836  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20837  if (likely(__pyx_t_5)) {
20838  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20839  __Pyx_INCREF(__pyx_t_5);
20840  __Pyx_INCREF(function);
20841  __Pyx_DECREF_SET(__pyx_t_1, function);
20842  }
20843  }
20844  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
20845  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20846  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20847  __Pyx_GOTREF(__pyx_t_4);
20848  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20849  __pyx_v___pyx_result = __pyx_t_4;
20850  __pyx_t_4 = 0;
20851 
20852  /* "(tree fragment)":8
20853  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20854  * __pyx_result = Enum.__new__(__pyx_type)
20855  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20856  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20857  * return __pyx_result
20858  */
20859  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20860  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20861  __pyx_t_2 = (__pyx_t_3 != 0);
20862  if (__pyx_t_2) {
20863 
20864  /* "(tree fragment)":9
20865  * __pyx_result = Enum.__new__(__pyx_type)
20866  * if __pyx_state is not None:
20867  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20868  * return __pyx_result
20869  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20870  */
20871  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20872  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20873  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20874  __Pyx_GOTREF(__pyx_t_4);
20875  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20876 
20877  /* "(tree fragment)":8
20878  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20879  * __pyx_result = Enum.__new__(__pyx_type)
20880  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20881  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20882  * return __pyx_result
20883  */
20884  }
20885 
20886  /* "(tree fragment)":10
20887  * if __pyx_state is not None:
20888  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20889  * return __pyx_result # <<<<<<<<<<<<<<
20890  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20891  * __pyx_result.name = __pyx_state[0]
20892  */
20893  __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20894  __Pyx_XDECREF(__pyx_r);
20895  __Pyx_INCREF(__pyx_v___pyx_result);
20896  __pyx_r = __pyx_v___pyx_result;
20897  goto __pyx_L0;
20898 
20899  /* "(tree fragment)":1
20900  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20901  * cdef object __pyx_PickleError
20902  * cdef object __pyx_result
20903  */
20904 
20905  /* function exit code */
20906  __pyx_L1_error:;
20907  __Pyx_XDECREF(__pyx_t_1);
20908  __Pyx_XDECREF(__pyx_t_4);
20909  __Pyx_XDECREF(__pyx_t_5);
20910  __Pyx_XDECREF(__pyx_t_6);
20911  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20912  __pyx_r = NULL;
20913  __pyx_L0:;
20914  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20915  __Pyx_XDECREF(__pyx_v___pyx_result);
20916  __Pyx_XGIVEREF(__pyx_r);
20917  __Pyx_TraceReturn(__pyx_r, 0);
20918  __Pyx_RefNannyFinishContext();
20919  return __pyx_r;
20920 }
20921 
20922 /* "(tree fragment)":11
20923  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20924  * return __pyx_result
20925  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20926  * __pyx_result.name = __pyx_state[0]
20927  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20928  */
20929 
20930 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20931  PyObject *__pyx_r = NULL;
20932  __Pyx_TraceDeclarations
20933  __Pyx_RefNannyDeclarations
20934  PyObject *__pyx_t_1 = NULL;
20935  int __pyx_t_2;
20936  Py_ssize_t __pyx_t_3;
20937  int __pyx_t_4;
20938  int __pyx_t_5;
20939  PyObject *__pyx_t_6 = NULL;
20940  PyObject *__pyx_t_7 = NULL;
20941  PyObject *__pyx_t_8 = NULL;
20942  int __pyx_lineno = 0;
20943  const char *__pyx_filename = NULL;
20944  int __pyx_clineno = 0;
20945  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20946  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20947 
20948  /* "(tree fragment)":12
20949  * return __pyx_result
20950  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20951  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20952  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20953  * __pyx_result.__dict__.update(__pyx_state[1])
20954  */
20955  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
20956  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20957  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20958  __PYX_ERR(1, 12, __pyx_L1_error)
20959  }
20960  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20961  __Pyx_GOTREF(__pyx_t_1);
20962  __Pyx_GIVEREF(__pyx_t_1);
20963  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20964  __Pyx_DECREF(__pyx_v___pyx_result->name);
20965  __pyx_v___pyx_result->name = __pyx_t_1;
20966  __pyx_t_1 = 0;
20967 
20968  /* "(tree fragment)":13
20969  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20970  * __pyx_result.name = __pyx_state[0]
20971  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20972  * __pyx_result.__dict__.update(__pyx_state[1])
20973  */
20974  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
20975  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20976  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20977  __PYX_ERR(1, 13, __pyx_L1_error)
20978  }
20979  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20980  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20981  if (__pyx_t_4) {
20982  } else {
20983  __pyx_t_2 = __pyx_t_4;
20984  goto __pyx_L4_bool_binop_done;
20985  }
20986  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20987  __pyx_t_5 = (__pyx_t_4 != 0);
20988  __pyx_t_2 = __pyx_t_5;
20989  __pyx_L4_bool_binop_done:;
20990  if (__pyx_t_2) {
20991 
20992  /* "(tree fragment)":14
20993  * __pyx_result.name = __pyx_state[0]
20994  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20995  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20996  */
20997  __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
20998  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20999  __Pyx_GOTREF(__pyx_t_6);
21000  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21001  __Pyx_GOTREF(__pyx_t_7);
21002  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21003  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21004  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21005  __PYX_ERR(1, 14, __pyx_L1_error)
21006  }
21007  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21008  __Pyx_GOTREF(__pyx_t_6);
21009  __pyx_t_8 = NULL;
21010  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21011  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21012  if (likely(__pyx_t_8)) {
21013  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21014  __Pyx_INCREF(__pyx_t_8);
21015  __Pyx_INCREF(function);
21016  __Pyx_DECREF_SET(__pyx_t_7, function);
21017  }
21018  }
21019  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21020  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21021  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21022  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21023  __Pyx_GOTREF(__pyx_t_1);
21024  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21025  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21026 
21027  /* "(tree fragment)":13
21028  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21029  * __pyx_result.name = __pyx_state[0]
21030  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21031  * __pyx_result.__dict__.update(__pyx_state[1])
21032  */
21033  }
21034 
21035  /* "(tree fragment)":11
21036  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21037  * return __pyx_result
21038  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21039  * __pyx_result.name = __pyx_state[0]
21040  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21041  */
21042 
21043  /* function exit code */
21044  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21045  goto __pyx_L0;
21046  __pyx_L1_error:;
21047  __Pyx_XDECREF(__pyx_t_1);
21048  __Pyx_XDECREF(__pyx_t_6);
21049  __Pyx_XDECREF(__pyx_t_7);
21050  __Pyx_XDECREF(__pyx_t_8);
21051  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21052  __pyx_r = 0;
21053  __pyx_L0:;
21054  __Pyx_XGIVEREF(__pyx_r);
21055  __Pyx_TraceReturn(__pyx_r, 0);
21056  __Pyx_RefNannyFinishContext();
21057  return __pyx_r;
21058 }
21059 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21060 
21061 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21062  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p;
21063  PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
21064  if (unlikely(!o)) return 0;
21065  p = ((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o);
21066  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21067  p->A_csr = Py_None; Py_INCREF(Py_None);
21068  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21069  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21070  if (unlikely(__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(o, a, k) < 0)) goto bad;
21071  return o;
21072  bad:
21073  Py_DECREF(o); o = 0;
21074  return NULL;
21075 }
21076 
21077 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21078  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21079  #if CYTHON_USE_TP_FINALIZE
21080  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21081  if (PyObject_CallFinalizerFromDealloc(o)) return;
21082  }
21083  #endif
21084  PyObject_GC_UnTrack(o);
21085  Py_CLEAR(p->A_csr);
21086  Py_CLEAR(p->A_indices_copy);
21087  Py_CLEAR(p->A_index_pointer_copy);
21088  PyObject_GC_Track(o);
21089  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21090 }
21091 
21092 static int __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o, visitproc v, void *a) {
21093  int e;
21094  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21095  e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix)); if (e) return e;
21096  if (p->A_csr) {
21097  e = (*v)(p->A_csr, a); if (e) return e;
21098  }
21099  if (p->A_indices_copy) {
21100  e = (*v)(p->A_indices_copy, a); if (e) return e;
21101  }
21102  if (p->A_index_pointer_copy) {
21103  e = (*v)(p->A_index_pointer_copy, a); if (e) return e;
21104  }
21105  return 0;
21106 }
21107 
21108 static int __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21109  PyObject* tmp;
21110  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21111  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) { if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21112  tmp = ((PyObject*)p->A_csr);
21113  p->A_csr = Py_None; Py_INCREF(Py_None);
21114  Py_XDECREF(tmp);
21115  tmp = ((PyObject*)p->A_indices_copy);
21116  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21117  Py_XDECREF(tmp);
21118  tmp = ((PyObject*)p->A_index_pointer_copy);
21119  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21120  Py_XDECREF(tmp);
21121  return 0;
21122 }
21123 
21124 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix[] = {
21125  {"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float},
21126  {"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double},
21127  {"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double},
21128  {"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float},
21129  {"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double},
21130  {"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double},
21131  {"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float},
21132  {"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double},
21133  {"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double},
21134  {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__},
21135  {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__},
21136  {0, 0, 0, 0}
21137 };
21138 
21139 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = {
21140  PyVarObject_HEAD_INIT(0, 0)
21141  "imate._c_linear_operator.py_c_matrix.pycMatrix", /*tp_name*/
21142  sizeof(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix), /*tp_basicsize*/
21143  0, /*tp_itemsize*/
21144  __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_dealloc*/
21145  #if PY_VERSION_HEX < 0x030800b4
21146  0, /*tp_print*/
21147  #endif
21148  #if PY_VERSION_HEX >= 0x030800b4
21149  0, /*tp_vectorcall_offset*/
21150  #endif
21151  0, /*tp_getattr*/
21152  0, /*tp_setattr*/
21153  #if PY_MAJOR_VERSION < 3
21154  0, /*tp_compare*/
21155  #endif
21156  #if PY_MAJOR_VERSION >= 3
21157  0, /*tp_as_async*/
21158  #endif
21159  0, /*tp_repr*/
21160  0, /*tp_as_number*/
21161  0, /*tp_as_sequence*/
21162  0, /*tp_as_mapping*/
21163  0, /*tp_hash*/
21164  0, /*tp_call*/
21165  0, /*tp_str*/
21166  0, /*tp_getattro*/
21167  0, /*tp_setattro*/
21168  0, /*tp_as_buffer*/
21169  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21170  "\n Defines a linear operator that is a constant matrix.\n\n **Initializing Object:**\n\n The object is initialized by a given matrix :math:`\\mathbf{A}` which can\n be a numpy array, or sparse matrices of any format (CSR, CSC, etc) using\n scipy sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrix of CSR format. Note the format of the input matrix\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n\n The following is an example of defining the operator with a dense matrix:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> cdef ConstantMatrix A = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do n""ot require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`AffineMatrixFunction`\n ", /*tp_doc*/
21171  __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_traverse*/
21172  __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_clear*/
21173  0, /*tp_richcompare*/
21174  0, /*tp_weaklistoffset*/
21175  0, /*tp_iter*/
21176  0, /*tp_iternext*/
21177  __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_methods*/
21178  0, /*tp_members*/
21179  0, /*tp_getset*/
21180  0, /*tp_base*/
21181  0, /*tp_dict*/
21182  0, /*tp_descr_get*/
21183  0, /*tp_descr_set*/
21184  0, /*tp_dictoffset*/
21185  0, /*tp_init*/
21186  0, /*tp_alloc*/
21187  __pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_new*/
21188  0, /*tp_free*/
21189  0, /*tp_is_gc*/
21190  0, /*tp_bases*/
21191  0, /*tp_mro*/
21192  0, /*tp_cache*/
21193  0, /*tp_subclasses*/
21194  0, /*tp_weaklist*/
21195  0, /*tp_del*/
21196  0, /*tp_version_tag*/
21197  #if PY_VERSION_HEX >= 0x030400a1
21198  0, /*tp_finalize*/
21199  #endif
21200  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21201  0, /*tp_vectorcall*/
21202  #endif
21203  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21204  0, /*tp_print*/
21205  #endif
21206  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21207  0, /*tp_pypy_flags*/
21208  #endif
21209 };
21210 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21211 
21212 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21213  struct __pyx_array_obj *p;
21214  PyObject *o;
21215  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21216  o = (*t->tp_alloc)(t, 0);
21217  } else {
21218  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21219  }
21220  if (unlikely(!o)) return 0;
21221  p = ((struct __pyx_array_obj *)o);
21222  p->__pyx_vtab = __pyx_vtabptr_array;
21223  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21224  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21225  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21226  return o;
21227  bad:
21228  Py_DECREF(o); o = 0;
21229  return NULL;
21230 }
21231 
21232 static void __pyx_tp_dealloc_array(PyObject *o) {
21233  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21234  #if CYTHON_USE_TP_FINALIZE
21235  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
21236  if (PyObject_CallFinalizerFromDealloc(o)) return;
21237  }
21238  #endif
21239  {
21240  PyObject *etype, *eval, *etb;
21241  PyErr_Fetch(&etype, &eval, &etb);
21242  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21243  __pyx_array___dealloc__(o);
21244  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21245  PyErr_Restore(etype, eval, etb);
21246  }
21247  Py_CLEAR(p->mode);
21248  Py_CLEAR(p->_format);
21249  (*Py_TYPE(o)->tp_free)(o);
21250 }
21251 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21252  PyObject *r;
21253  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21254  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21255  Py_DECREF(x);
21256  return r;
21257 }
21258 
21259 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21260  if (v) {
21261  return __pyx_array___setitem__(o, i, v);
21262  }
21263  else {
21264  PyErr_Format(PyExc_NotImplementedError,
21265  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21266  return -1;
21267  }
21268 }
21269 
21270 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21271  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21272  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21273  PyErr_Clear();
21274  v = __pyx_array___getattr__(o, n);
21275  }
21276  return v;
21277 }
21278 
21279 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21280  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21281 }
21282 
21283 static PyMethodDef __pyx_methods_array[] = {
21284  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21285  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21286  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21287  {0, 0, 0, 0}
21288 };
21289 
21290 static struct PyGetSetDef __pyx_getsets_array[] = {
21291  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21292  {0, 0, 0, 0, 0}
21293 };
21294 
21295 static PySequenceMethods __pyx_tp_as_sequence_array = {
21296  __pyx_array___len__, /*sq_length*/
21297  0, /*sq_concat*/
21298  0, /*sq_repeat*/
21299  __pyx_sq_item_array, /*sq_item*/
21300  0, /*sq_slice*/
21301  0, /*sq_ass_item*/
21302  0, /*sq_ass_slice*/
21303  0, /*sq_contains*/
21304  0, /*sq_inplace_concat*/
21305  0, /*sq_inplace_repeat*/
21306 };
21307 
21308 static PyMappingMethods __pyx_tp_as_mapping_array = {
21309  __pyx_array___len__, /*mp_length*/
21310  __pyx_array___getitem__, /*mp_subscript*/
21311  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21312 };
21313 
21314 static PyBufferProcs __pyx_tp_as_buffer_array = {
21315  #if PY_MAJOR_VERSION < 3
21316  0, /*bf_getreadbuffer*/
21317  #endif
21318  #if PY_MAJOR_VERSION < 3
21319  0, /*bf_getwritebuffer*/
21320  #endif
21321  #if PY_MAJOR_VERSION < 3
21322  0, /*bf_getsegcount*/
21323  #endif
21324  #if PY_MAJOR_VERSION < 3
21325  0, /*bf_getcharbuffer*/
21326  #endif
21327  __pyx_array_getbuffer, /*bf_getbuffer*/
21328  0, /*bf_releasebuffer*/
21329 };
21330 
21331 static PyTypeObject __pyx_type___pyx_array = {
21332  PyVarObject_HEAD_INIT(0, 0)
21333  "imate._c_linear_operator.py_c_matrix.array", /*tp_name*/
21334  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21335  0, /*tp_itemsize*/
21336  __pyx_tp_dealloc_array, /*tp_dealloc*/
21337  #if PY_VERSION_HEX < 0x030800b4
21338  0, /*tp_print*/
21339  #endif
21340  #if PY_VERSION_HEX >= 0x030800b4
21341  0, /*tp_vectorcall_offset*/
21342  #endif
21343  0, /*tp_getattr*/
21344  0, /*tp_setattr*/
21345  #if PY_MAJOR_VERSION < 3
21346  0, /*tp_compare*/
21347  #endif
21348  #if PY_MAJOR_VERSION >= 3
21349  0, /*tp_as_async*/
21350  #endif
21351  0, /*tp_repr*/
21352  0, /*tp_as_number*/
21353  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21354  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21355  0, /*tp_hash*/
21356  0, /*tp_call*/
21357  0, /*tp_str*/
21358  __pyx_tp_getattro_array, /*tp_getattro*/
21359  0, /*tp_setattro*/
21360  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21361  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21362  0, /*tp_doc*/
21363  0, /*tp_traverse*/
21364  0, /*tp_clear*/
21365  0, /*tp_richcompare*/
21366  0, /*tp_weaklistoffset*/
21367  0, /*tp_iter*/
21368  0, /*tp_iternext*/
21369  __pyx_methods_array, /*tp_methods*/
21370  0, /*tp_members*/
21371  __pyx_getsets_array, /*tp_getset*/
21372  0, /*tp_base*/
21373  0, /*tp_dict*/
21374  0, /*tp_descr_get*/
21375  0, /*tp_descr_set*/
21376  0, /*tp_dictoffset*/
21377  0, /*tp_init*/
21378  0, /*tp_alloc*/
21379  __pyx_tp_new_array, /*tp_new*/
21380  0, /*tp_free*/
21381  0, /*tp_is_gc*/
21382  0, /*tp_bases*/
21383  0, /*tp_mro*/
21384  0, /*tp_cache*/
21385  0, /*tp_subclasses*/
21386  0, /*tp_weaklist*/
21387  0, /*tp_del*/
21388  0, /*tp_version_tag*/
21389  #if PY_VERSION_HEX >= 0x030400a1
21390  0, /*tp_finalize*/
21391  #endif
21392  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21393  0, /*tp_vectorcall*/
21394  #endif
21395  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21396  0, /*tp_print*/
21397  #endif
21398  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21399  0, /*tp_pypy_flags*/
21400  #endif
21401 };
21402 
21403 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21404  struct __pyx_MemviewEnum_obj *p;
21405  PyObject *o;
21406  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21407  o = (*t->tp_alloc)(t, 0);
21408  } else {
21409  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21410  }
21411  if (unlikely(!o)) return 0;
21412  p = ((struct __pyx_MemviewEnum_obj *)o);
21413  p->name = Py_None; Py_INCREF(Py_None);
21414  return o;
21415 }
21416 
21417 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21418  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21419  #if CYTHON_USE_TP_FINALIZE
21420  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21421  if (PyObject_CallFinalizerFromDealloc(o)) return;
21422  }
21423  #endif
21424  PyObject_GC_UnTrack(o);
21425  Py_CLEAR(p->name);
21426  (*Py_TYPE(o)->tp_free)(o);
21427 }
21428 
21429 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21430  int e;
21431  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21432  if (p->name) {
21433  e = (*v)(p->name, a); if (e) return e;
21434  }
21435  return 0;
21436 }
21437 
21438 static int __pyx_tp_clear_Enum(PyObject *o) {
21439  PyObject* tmp;
21440  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21441  tmp = ((PyObject*)p->name);
21442  p->name = Py_None; Py_INCREF(Py_None);
21443  Py_XDECREF(tmp);
21444  return 0;
21445 }
21446 
21447 static PyMethodDef __pyx_methods_Enum[] = {
21448  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21449  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21450  {0, 0, 0, 0}
21451 };
21452 
21453 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21454  PyVarObject_HEAD_INIT(0, 0)
21455  "imate._c_linear_operator.py_c_matrix.Enum", /*tp_name*/
21456  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21457  0, /*tp_itemsize*/
21458  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21459  #if PY_VERSION_HEX < 0x030800b4
21460  0, /*tp_print*/
21461  #endif
21462  #if PY_VERSION_HEX >= 0x030800b4
21463  0, /*tp_vectorcall_offset*/
21464  #endif
21465  0, /*tp_getattr*/
21466  0, /*tp_setattr*/
21467  #if PY_MAJOR_VERSION < 3
21468  0, /*tp_compare*/
21469  #endif
21470  #if PY_MAJOR_VERSION >= 3
21471  0, /*tp_as_async*/
21472  #endif
21473  __pyx_MemviewEnum___repr__, /*tp_repr*/
21474  0, /*tp_as_number*/
21475  0, /*tp_as_sequence*/
21476  0, /*tp_as_mapping*/
21477  0, /*tp_hash*/
21478  0, /*tp_call*/
21479  0, /*tp_str*/
21480  0, /*tp_getattro*/
21481  0, /*tp_setattro*/
21482  0, /*tp_as_buffer*/
21483  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21484  0, /*tp_doc*/
21485  __pyx_tp_traverse_Enum, /*tp_traverse*/
21486  __pyx_tp_clear_Enum, /*tp_clear*/
21487  0, /*tp_richcompare*/
21488  0, /*tp_weaklistoffset*/
21489  0, /*tp_iter*/
21490  0, /*tp_iternext*/
21491  __pyx_methods_Enum, /*tp_methods*/
21492  0, /*tp_members*/
21493  0, /*tp_getset*/
21494  0, /*tp_base*/
21495  0, /*tp_dict*/
21496  0, /*tp_descr_get*/
21497  0, /*tp_descr_set*/
21498  0, /*tp_dictoffset*/
21499  __pyx_MemviewEnum___init__, /*tp_init*/
21500  0, /*tp_alloc*/
21501  __pyx_tp_new_Enum, /*tp_new*/
21502  0, /*tp_free*/
21503  0, /*tp_is_gc*/
21504  0, /*tp_bases*/
21505  0, /*tp_mro*/
21506  0, /*tp_cache*/
21507  0, /*tp_subclasses*/
21508  0, /*tp_weaklist*/
21509  0, /*tp_del*/
21510  0, /*tp_version_tag*/
21511  #if PY_VERSION_HEX >= 0x030400a1
21512  0, /*tp_finalize*/
21513  #endif
21514  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21515  0, /*tp_vectorcall*/
21516  #endif
21517  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21518  0, /*tp_print*/
21519  #endif
21520  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21521  0, /*tp_pypy_flags*/
21522  #endif
21523 };
21524 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21525 
21526 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21527  struct __pyx_memoryview_obj *p;
21528  PyObject *o;
21529  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21530  o = (*t->tp_alloc)(t, 0);
21531  } else {
21532  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21533  }
21534  if (unlikely(!o)) return 0;
21535  p = ((struct __pyx_memoryview_obj *)o);
21536  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21537  p->obj = Py_None; Py_INCREF(Py_None);
21538  p->_size = Py_None; Py_INCREF(Py_None);
21539  p->_array_interface = Py_None; Py_INCREF(Py_None);
21540  p->view.obj = NULL;
21541  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21542  return o;
21543  bad:
21544  Py_DECREF(o); o = 0;
21545  return NULL;
21546 }
21547 
21548 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21549  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21550  #if CYTHON_USE_TP_FINALIZE
21551  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21552  if (PyObject_CallFinalizerFromDealloc(o)) return;
21553  }
21554  #endif
21555  PyObject_GC_UnTrack(o);
21556  {
21557  PyObject *etype, *eval, *etb;
21558  PyErr_Fetch(&etype, &eval, &etb);
21559  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21560  __pyx_memoryview___dealloc__(o);
21561  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21562  PyErr_Restore(etype, eval, etb);
21563  }
21564  Py_CLEAR(p->obj);
21565  Py_CLEAR(p->_size);
21566  Py_CLEAR(p->_array_interface);
21567  (*Py_TYPE(o)->tp_free)(o);
21568 }
21569 
21570 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21571  int e;
21572  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21573  if (p->obj) {
21574  e = (*v)(p->obj, a); if (e) return e;
21575  }
21576  if (p->_size) {
21577  e = (*v)(p->_size, a); if (e) return e;
21578  }
21579  if (p->_array_interface) {
21580  e = (*v)(p->_array_interface, a); if (e) return e;
21581  }
21582  if (p->view.obj) {
21583  e = (*v)(p->view.obj, a); if (e) return e;
21584  }
21585  return 0;
21586 }
21587 
21588 static int __pyx_tp_clear_memoryview(PyObject *o) {
21589  PyObject* tmp;
21590  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21591  tmp = ((PyObject*)p->obj);
21592  p->obj = Py_None; Py_INCREF(Py_None);
21593  Py_XDECREF(tmp);
21594  tmp = ((PyObject*)p->_size);
21595  p->_size = Py_None; Py_INCREF(Py_None);
21596  Py_XDECREF(tmp);
21597  tmp = ((PyObject*)p->_array_interface);
21598  p->_array_interface = Py_None; Py_INCREF(Py_None);
21599  Py_XDECREF(tmp);
21600  Py_CLEAR(p->view.obj);
21601  return 0;
21602 }
21603 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21604  PyObject *r;
21605  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21606  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21607  Py_DECREF(x);
21608  return r;
21609 }
21610 
21611 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21612  if (v) {
21613  return __pyx_memoryview___setitem__(o, i, v);
21614  }
21615  else {
21616  PyErr_Format(PyExc_NotImplementedError,
21617  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21618  return -1;
21619  }
21620 }
21621 
21622 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21623  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21624 }
21625 
21626 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21627  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21628 }
21629 
21630 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21631  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21632 }
21633 
21634 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21635  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21636 }
21637 
21638 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21639  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21640 }
21641 
21642 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21643  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21644 }
21645 
21646 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21647  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21648 }
21649 
21650 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21651  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21652 }
21653 
21654 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21655  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21656 }
21657 
21658 static PyMethodDef __pyx_methods_memoryview[] = {
21659  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21660  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21661  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21662  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21663  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21664  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21665  {0, 0, 0, 0}
21666 };
21667 
21668 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21669  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21670  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21671  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21672  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21673  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21674  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21675  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21676  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21677  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21678  {0, 0, 0, 0, 0}
21679 };
21680 
21681 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21682  __pyx_memoryview___len__, /*sq_length*/
21683  0, /*sq_concat*/
21684  0, /*sq_repeat*/
21685  __pyx_sq_item_memoryview, /*sq_item*/
21686  0, /*sq_slice*/
21687  0, /*sq_ass_item*/
21688  0, /*sq_ass_slice*/
21689  0, /*sq_contains*/
21690  0, /*sq_inplace_concat*/
21691  0, /*sq_inplace_repeat*/
21692 };
21693 
21694 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21695  __pyx_memoryview___len__, /*mp_length*/
21696  __pyx_memoryview___getitem__, /*mp_subscript*/
21697  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21698 };
21699 
21700 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21701  #if PY_MAJOR_VERSION < 3
21702  0, /*bf_getreadbuffer*/
21703  #endif
21704  #if PY_MAJOR_VERSION < 3
21705  0, /*bf_getwritebuffer*/
21706  #endif
21707  #if PY_MAJOR_VERSION < 3
21708  0, /*bf_getsegcount*/
21709  #endif
21710  #if PY_MAJOR_VERSION < 3
21711  0, /*bf_getcharbuffer*/
21712  #endif
21713  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21714  0, /*bf_releasebuffer*/
21715 };
21716 
21717 static PyTypeObject __pyx_type___pyx_memoryview = {
21718  PyVarObject_HEAD_INIT(0, 0)
21719  "imate._c_linear_operator.py_c_matrix.memoryview", /*tp_name*/
21720  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21721  0, /*tp_itemsize*/
21722  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21723  #if PY_VERSION_HEX < 0x030800b4
21724  0, /*tp_print*/
21725  #endif
21726  #if PY_VERSION_HEX >= 0x030800b4
21727  0, /*tp_vectorcall_offset*/
21728  #endif
21729  0, /*tp_getattr*/
21730  0, /*tp_setattr*/
21731  #if PY_MAJOR_VERSION < 3
21732  0, /*tp_compare*/
21733  #endif
21734  #if PY_MAJOR_VERSION >= 3
21735  0, /*tp_as_async*/
21736  #endif
21737  __pyx_memoryview___repr__, /*tp_repr*/
21738  0, /*tp_as_number*/
21739  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21740  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21741  0, /*tp_hash*/
21742  0, /*tp_call*/
21743  __pyx_memoryview___str__, /*tp_str*/
21744  0, /*tp_getattro*/
21745  0, /*tp_setattro*/
21746  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21747  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21748  0, /*tp_doc*/
21749  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21750  __pyx_tp_clear_memoryview, /*tp_clear*/
21751  0, /*tp_richcompare*/
21752  0, /*tp_weaklistoffset*/
21753  0, /*tp_iter*/
21754  0, /*tp_iternext*/
21755  __pyx_methods_memoryview, /*tp_methods*/
21756  0, /*tp_members*/
21757  __pyx_getsets_memoryview, /*tp_getset*/
21758  0, /*tp_base*/
21759  0, /*tp_dict*/
21760  0, /*tp_descr_get*/
21761  0, /*tp_descr_set*/
21762  0, /*tp_dictoffset*/
21763  0, /*tp_init*/
21764  0, /*tp_alloc*/
21765  __pyx_tp_new_memoryview, /*tp_new*/
21766  0, /*tp_free*/
21767  0, /*tp_is_gc*/
21768  0, /*tp_bases*/
21769  0, /*tp_mro*/
21770  0, /*tp_cache*/
21771  0, /*tp_subclasses*/
21772  0, /*tp_weaklist*/
21773  0, /*tp_del*/
21774  0, /*tp_version_tag*/
21775  #if PY_VERSION_HEX >= 0x030400a1
21776  0, /*tp_finalize*/
21777  #endif
21778  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21779  0, /*tp_vectorcall*/
21780  #endif
21781  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21782  0, /*tp_print*/
21783  #endif
21784  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21785  0, /*tp_pypy_flags*/
21786  #endif
21787 };
21788 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21789 
21790 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21791  struct __pyx_memoryviewslice_obj *p;
21792  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21793  if (unlikely(!o)) return 0;
21794  p = ((struct __pyx_memoryviewslice_obj *)o);
21795  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21796  p->from_object = Py_None; Py_INCREF(Py_None);
21797  p->from_slice.memview = NULL;
21798  return o;
21799 }
21800 
21801 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21802  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21803  #if CYTHON_USE_TP_FINALIZE
21804  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21805  if (PyObject_CallFinalizerFromDealloc(o)) return;
21806  }
21807  #endif
21808  PyObject_GC_UnTrack(o);
21809  {
21810  PyObject *etype, *eval, *etb;
21811  PyErr_Fetch(&etype, &eval, &etb);
21812  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21813  __pyx_memoryviewslice___dealloc__(o);
21814  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21815  PyErr_Restore(etype, eval, etb);
21816  }
21817  Py_CLEAR(p->from_object);
21818  PyObject_GC_Track(o);
21819  __pyx_tp_dealloc_memoryview(o);
21820 }
21821 
21822 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21823  int e;
21824  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21825  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21826  if (p->from_object) {
21827  e = (*v)(p->from_object, a); if (e) return e;
21828  }
21829  return 0;
21830 }
21831 
21832 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21833  PyObject* tmp;
21834  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21835  __pyx_tp_clear_memoryview(o);
21836  tmp = ((PyObject*)p->from_object);
21837  p->from_object = Py_None; Py_INCREF(Py_None);
21838  Py_XDECREF(tmp);
21839  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21840  return 0;
21841 }
21842 
21843 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21844  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21845 }
21846 
21847 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21848  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21849  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21850  {0, 0, 0, 0}
21851 };
21852 
21853 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21854  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21855  {0, 0, 0, 0, 0}
21856 };
21857 
21858 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21859  PyVarObject_HEAD_INIT(0, 0)
21860  "imate._c_linear_operator.py_c_matrix._memoryviewslice", /*tp_name*/
21861  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21862  0, /*tp_itemsize*/
21863  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21864  #if PY_VERSION_HEX < 0x030800b4
21865  0, /*tp_print*/
21866  #endif
21867  #if PY_VERSION_HEX >= 0x030800b4
21868  0, /*tp_vectorcall_offset*/
21869  #endif
21870  0, /*tp_getattr*/
21871  0, /*tp_setattr*/
21872  #if PY_MAJOR_VERSION < 3
21873  0, /*tp_compare*/
21874  #endif
21875  #if PY_MAJOR_VERSION >= 3
21876  0, /*tp_as_async*/
21877  #endif
21878  #if CYTHON_COMPILING_IN_PYPY
21879  __pyx_memoryview___repr__, /*tp_repr*/
21880  #else
21881  0, /*tp_repr*/
21882  #endif
21883  0, /*tp_as_number*/
21884  0, /*tp_as_sequence*/
21885  0, /*tp_as_mapping*/
21886  0, /*tp_hash*/
21887  0, /*tp_call*/
21888  #if CYTHON_COMPILING_IN_PYPY
21889  __pyx_memoryview___str__, /*tp_str*/
21890  #else
21891  0, /*tp_str*/
21892  #endif
21893  0, /*tp_getattro*/
21894  0, /*tp_setattro*/
21895  0, /*tp_as_buffer*/
21896  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21897  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21898  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21899  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21900  0, /*tp_richcompare*/
21901  0, /*tp_weaklistoffset*/
21902  0, /*tp_iter*/
21903  0, /*tp_iternext*/
21904  __pyx_methods__memoryviewslice, /*tp_methods*/
21905  0, /*tp_members*/
21906  __pyx_getsets__memoryviewslice, /*tp_getset*/
21907  0, /*tp_base*/
21908  0, /*tp_dict*/
21909  0, /*tp_descr_get*/
21910  0, /*tp_descr_set*/
21911  0, /*tp_dictoffset*/
21912  0, /*tp_init*/
21913  0, /*tp_alloc*/
21914  __pyx_tp_new__memoryviewslice, /*tp_new*/
21915  0, /*tp_free*/
21916  0, /*tp_is_gc*/
21917  0, /*tp_bases*/
21918  0, /*tp_mro*/
21919  0, /*tp_cache*/
21920  0, /*tp_subclasses*/
21921  0, /*tp_weaklist*/
21922  0, /*tp_del*/
21923  0, /*tp_version_tag*/
21924  #if PY_VERSION_HEX >= 0x030400a1
21925  0, /*tp_finalize*/
21926  #endif
21927  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21928  0, /*tp_vectorcall*/
21929  #endif
21930  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21931  0, /*tp_print*/
21932  #endif
21933  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21934  0, /*tp_pypy_flags*/
21935  #endif
21936 };
21937 
21938 static PyMethodDef __pyx_methods[] = {
21939  {0, 0, 0, 0}
21940 };
21941 
21942 #if PY_MAJOR_VERSION >= 3
21943 #if CYTHON_PEP489_MULTI_PHASE_INIT
21944 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21945 static int __pyx_pymod_exec_py_c_matrix(PyObject* module); /*proto*/
21946 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21947  {Py_mod_create, (void*)__pyx_pymod_create},
21948  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_matrix},
21949  {0, NULL}
21950 };
21951 #endif
21952 
21953 static struct PyModuleDef __pyx_moduledef = {
21954  PyModuleDef_HEAD_INIT,
21955  "py_c_matrix",
21956  0, /* m_doc */
21957  #if CYTHON_PEP489_MULTI_PHASE_INIT
21958  0, /* m_size */
21959  #else
21960  -1, /* m_size */
21961  #endif
21962  __pyx_methods /* m_methods */,
21963  #if CYTHON_PEP489_MULTI_PHASE_INIT
21964  __pyx_moduledef_slots, /* m_slots */
21965  #else
21966  NULL, /* m_reload */
21967  #endif
21968  NULL, /* m_traverse */
21969  NULL, /* m_clear */
21970  NULL /* m_free */
21971 };
21972 #endif
21973 #ifndef CYTHON_SMALL_CODE
21974 #if defined(__clang__)
21975  #define CYTHON_SMALL_CODE
21976 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21977  #define CYTHON_SMALL_CODE __attribute__((cold))
21978 #else
21979  #define CYTHON_SMALL_CODE
21980 #endif
21981 #endif
21982 
21983 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21984  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
21985  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21986  {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None, sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
21987  {&__pyx_n_s_A_data_double, __pyx_k_A_data_double, sizeof(__pyx_k_A_data_double), 0, 0, 1, 1},
21988  {&__pyx_n_s_A_data_double_mv, __pyx_k_A_data_double_mv, sizeof(__pyx_k_A_data_double_mv), 0, 0, 1, 1},
21989  {&__pyx_n_s_A_data_double_mv_c, __pyx_k_A_data_double_mv_c, sizeof(__pyx_k_A_data_double_mv_c), 0, 0, 1, 1},
21990  {&__pyx_n_s_A_data_double_mv_f, __pyx_k_A_data_double_mv_f, sizeof(__pyx_k_A_data_double_mv_f), 0, 0, 1, 1},
21991  {&__pyx_n_s_A_data_float, __pyx_k_A_data_float, sizeof(__pyx_k_A_data_float), 0, 0, 1, 1},
21992  {&__pyx_n_s_A_data_float_mv, __pyx_k_A_data_float_mv, sizeof(__pyx_k_A_data_float_mv), 0, 0, 1, 1},
21993  {&__pyx_n_s_A_data_float_mv_c, __pyx_k_A_data_float_mv_c, sizeof(__pyx_k_A_data_float_mv_c), 0, 0, 1, 1},
21994  {&__pyx_n_s_A_data_float_mv_f, __pyx_k_A_data_float_mv_f, sizeof(__pyx_k_A_data_float_mv_f), 0, 0, 1, 1},
21995  {&__pyx_n_s_A_data_long_double, __pyx_k_A_data_long_double, sizeof(__pyx_k_A_data_long_double), 0, 0, 1, 1},
21996  {&__pyx_n_s_A_data_long_double_mv, __pyx_k_A_data_long_double_mv, sizeof(__pyx_k_A_data_long_double_mv), 0, 0, 1, 1},
21997  {&__pyx_n_s_A_data_long_double_mv_c, __pyx_k_A_data_long_double_mv_c, sizeof(__pyx_k_A_data_long_double_mv_c), 0, 0, 1, 1},
21998  {&__pyx_n_s_A_data_long_double_mv_f, __pyx_k_A_data_long_double_mv_f, sizeof(__pyx_k_A_data_long_double_mv_f), 0, 0, 1, 1},
21999  {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer, sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
22000  {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv, sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
22001  {&__pyx_n_s_A_indices, __pyx_k_A_indices, sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
22002  {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv, sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
22003  {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major, sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
22004  {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns, sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
22005  {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows, sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
22006  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22007  {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
22008  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22009  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22010  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22011  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22012  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
22013  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22014  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22015  {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS, sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
22016  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
22017  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22018  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22019  {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen, sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
22020  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22021  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22022  {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
22023  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22024  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22025  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22026  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22027  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22028  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22029  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22030  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22031  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22032  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22033  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22034  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
22035  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22036  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22037  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22038  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22039  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22040  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22041  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22042  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
22043  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
22044  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
22045  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22046  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
22047  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22048  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22049  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22050  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22051  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22052  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
22053  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
22054  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
22055  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22056  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22057  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22058  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22059  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22060  {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices, sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
22061  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22062  {&__pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_k_imate__c_linear_operator_py_c_ma, sizeof(__pyx_k_imate__c_linear_operator_py_c_ma), 0, 0, 1, 0},
22063  {&__pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_k_imate__c_linear_operator_py_c_ma_2, sizeof(__pyx_k_imate__c_linear_operator_py_c_ma_2), 0, 0, 1, 1},
22064  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22065  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
22066  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
22067  {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
22068  {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc, sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
22069  {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr, sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
22070  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22071  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22072  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22073  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22074  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22075  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22076  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22077  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22078  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22079  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22080  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22081  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22082  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22083  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22084  {&__pyx_n_s_pycMatrix, __pyx_k_pycMatrix, sizeof(__pyx_k_pycMatrix), 0, 0, 1, 1},
22085  {&__pyx_n_s_pycMatrix___reduce_cython, __pyx_k_pycMatrix___reduce_cython, sizeof(__pyx_k_pycMatrix___reduce_cython), 0, 0, 1, 1},
22086  {&__pyx_n_s_pycMatrix___setstate_cython, __pyx_k_pycMatrix___setstate_cython, sizeof(__pyx_k_pycMatrix___setstate_cython), 0, 0, 1, 1},
22087  {&__pyx_n_s_pycMatrix_set_csc_matrix_double, __pyx_k_pycMatrix_set_csc_matrix_double, sizeof(__pyx_k_pycMatrix_set_csc_matrix_double), 0, 0, 1, 1},
22088  {&__pyx_n_s_pycMatrix_set_csc_matrix_float, __pyx_k_pycMatrix_set_csc_matrix_float, sizeof(__pyx_k_pycMatrix_set_csc_matrix_float), 0, 0, 1, 1},
22089  {&__pyx_n_s_pycMatrix_set_csc_matrix_long_do, __pyx_k_pycMatrix_set_csc_matrix_long_do, sizeof(__pyx_k_pycMatrix_set_csc_matrix_long_do), 0, 0, 1, 1},
22090  {&__pyx_n_s_pycMatrix_set_csr_matrix_double, __pyx_k_pycMatrix_set_csr_matrix_double, sizeof(__pyx_k_pycMatrix_set_csr_matrix_double), 0, 0, 1, 1},
22091  {&__pyx_n_s_pycMatrix_set_csr_matrix_float, __pyx_k_pycMatrix_set_csr_matrix_float, sizeof(__pyx_k_pycMatrix_set_csr_matrix_float), 0, 0, 1, 1},
22092  {&__pyx_n_s_pycMatrix_set_csr_matrix_long_do, __pyx_k_pycMatrix_set_csr_matrix_long_do, sizeof(__pyx_k_pycMatrix_set_csr_matrix_long_do), 0, 0, 1, 1},
22093  {&__pyx_n_s_pycMatrix_set_dense_matrix_doubl, __pyx_k_pycMatrix_set_dense_matrix_doubl, sizeof(__pyx_k_pycMatrix_set_dense_matrix_doubl), 0, 0, 1, 1},
22094  {&__pyx_n_s_pycMatrix_set_dense_matrix_float, __pyx_k_pycMatrix_set_dense_matrix_float, sizeof(__pyx_k_pycMatrix_set_dense_matrix_float), 0, 0, 1, 1},
22095  {&__pyx_n_s_pycMatrix_set_dense_matrix_long, __pyx_k_pycMatrix_set_dense_matrix_long, sizeof(__pyx_k_pycMatrix_set_dense_matrix_long), 0, 0, 1, 1},
22096  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22097  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22098  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22099  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22100  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22101  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22102  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22103  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22104  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22105  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22106  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22107  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22108  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
22109  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22110  {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double, sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
22111  {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float, sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
22112  {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double, sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
22113  {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double, sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
22114  {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float, sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
22115  {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double, sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
22116  {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double, sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
22117  {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float, sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
22118  {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double, sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
22119  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22120  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22121  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22122  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22123  {&__pyx_n_s_sort_indices, __pyx_k_sort_indices, sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
22124  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22125  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22126  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22127  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22128  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22129  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22130  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22131  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22132  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22133  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22134  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22135  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22136  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22137  {0, 0, 0, 0, 0, 0, 0}
22138 };
22139 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22140  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
22141  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 142, __pyx_L1_error)
22142  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
22143  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
22144  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
22145  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
22146  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
22147  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
22148  return 0;
22149  __pyx_L1_error:;
22150  return -1;
22151 }
22152 
22153 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22154  __Pyx_RefNannyDeclarations
22155  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22156 
22157  /* "imate/_c_linear_operator/py_c_matrix.pyx":126
22158  * # Check A
22159  * if A is None:
22160  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
22161  *
22162  * if A.ndim != 2:
22163  */
22164  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 126, __pyx_L1_error)
22165  __Pyx_GOTREF(__pyx_tuple_);
22166  __Pyx_GIVEREF(__pyx_tuple_);
22167 
22168  /* "imate/_c_linear_operator/py_c_matrix.pyx":129
22169  *
22170  * if A.ndim != 2:
22171  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
22172  *
22173  * # Data type
22174  */
22175  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error)
22176  __Pyx_GOTREF(__pyx_tuple__2);
22177  __Pyx_GIVEREF(__pyx_tuple__2);
22178 
22179  /* "imate/_c_linear_operator/py_c_matrix.pyx":142
22180  *
22181  * else:
22182  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
22183  * '"float128".')
22184  *
22185  */
22186  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error)
22187  __Pyx_GOTREF(__pyx_tuple__3);
22188  __Pyx_GIVEREF(__pyx_tuple__3);
22189 
22190  /* "imate/_c_linear_operator/py_c_matrix.pyx":235
22191  * A_is_row_major = 0
22192  * else:
22193  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
22194  *
22195  * # Declare memoryviews to get data pointer
22196  */
22197  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 235, __pyx_L1_error)
22198  __Pyx_GOTREF(__pyx_tuple__5);
22199  __Pyx_GIVEREF(__pyx_tuple__5);
22200 
22201  /* "(tree fragment)":2
22202  * def __reduce_cython__(self):
22203  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22204  * def __setstate_cython__(self, __pyx_state):
22205  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22206  */
22207  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
22208  __Pyx_GOTREF(__pyx_tuple__15);
22209  __Pyx_GIVEREF(__pyx_tuple__15);
22210 
22211  /* "(tree fragment)":4
22212  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22213  * def __setstate_cython__(self, __pyx_state):
22214  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22215  */
22216  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
22217  __Pyx_GOTREF(__pyx_tuple__17);
22218  __Pyx_GIVEREF(__pyx_tuple__17);
22219 
22220  /* "View.MemoryView":134
22221  *
22222  * if not self.ndim:
22223  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22224  *
22225  * if itemsize <= 0:
22226  */
22227  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 134, __pyx_L1_error)
22228  __Pyx_GOTREF(__pyx_tuple__18);
22229  __Pyx_GIVEREF(__pyx_tuple__18);
22230 
22231  /* "View.MemoryView":137
22232  *
22233  * if itemsize <= 0:
22234  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22235  *
22236  * if not isinstance(format, bytes):
22237  */
22238  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 137, __pyx_L1_error)
22239  __Pyx_GOTREF(__pyx_tuple__19);
22240  __Pyx_GIVEREF(__pyx_tuple__19);
22241 
22242  /* "View.MemoryView":149
22243  *
22244  * if not self._shape:
22245  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22246  *
22247  *
22248  */
22249  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 149, __pyx_L1_error)
22250  __Pyx_GOTREF(__pyx_tuple__20);
22251  __Pyx_GIVEREF(__pyx_tuple__20);
22252 
22253  /* "View.MemoryView":177
22254  * self.data = <char *>malloc(self.len)
22255  * if not self.data:
22256  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22257  *
22258  * if self.dtype_is_object:
22259  */
22260  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 177, __pyx_L1_error)
22261  __Pyx_GOTREF(__pyx_tuple__21);
22262  __Pyx_GIVEREF(__pyx_tuple__21);
22263 
22264  /* "View.MemoryView":193
22265  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22266  * if not (flags & bufmode):
22267  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22268  * info.buf = self.data
22269  * info.len = self.len
22270  */
22271  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 193, __pyx_L1_error)
22272  __Pyx_GOTREF(__pyx_tuple__22);
22273  __Pyx_GIVEREF(__pyx_tuple__22);
22274 
22275  /* "(tree fragment)":2
22276  * def __reduce_cython__(self):
22277  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22278  * def __setstate_cython__(self, __pyx_state):
22279  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22280  */
22281  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22282  __Pyx_GOTREF(__pyx_tuple__23);
22283  __Pyx_GIVEREF(__pyx_tuple__23);
22284 
22285  /* "(tree fragment)":4
22286  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22287  * def __setstate_cython__(self, __pyx_state):
22288  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22289  */
22290  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22291  __Pyx_GOTREF(__pyx_tuple__24);
22292  __Pyx_GIVEREF(__pyx_tuple__24);
22293 
22294  /* "View.MemoryView":420
22295  * def __setitem__(memoryview self, object index, object value):
22296  * if self.view.readonly:
22297  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22298  *
22299  * have_slices, index = _unellipsify(index, self.view.ndim)
22300  */
22301  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 420, __pyx_L1_error)
22302  __Pyx_GOTREF(__pyx_tuple__25);
22303  __Pyx_GIVEREF(__pyx_tuple__25);
22304 
22305  /* "View.MemoryView":497
22306  * result = struct.unpack(self.view.format, bytesitem)
22307  * except struct.error:
22308  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22309  * else:
22310  * if len(self.view.format) == 1:
22311  */
22312  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 497, __pyx_L1_error)
22313  __Pyx_GOTREF(__pyx_tuple__26);
22314  __Pyx_GIVEREF(__pyx_tuple__26);
22315 
22316  /* "View.MemoryView":522
22317  * def __getbuffer__(self, Py_buffer *info, int flags):
22318  * if flags & PyBUF_WRITABLE and self.view.readonly:
22319  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22320  *
22321  * if flags & PyBUF_ND:
22322  */
22323  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 522, __pyx_L1_error)
22324  __Pyx_GOTREF(__pyx_tuple__27);
22325  __Pyx_GIVEREF(__pyx_tuple__27);
22326 
22327  /* "View.MemoryView":572
22328  * if self.view.strides == NULL:
22329  *
22330  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22331  *
22332  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22333  */
22334  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 572, __pyx_L1_error)
22335  __Pyx_GOTREF(__pyx_tuple__28);
22336  __Pyx_GIVEREF(__pyx_tuple__28);
22337 
22338  /* "View.MemoryView":579
22339  * def suboffsets(self):
22340  * if self.view.suboffsets == NULL:
22341  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22342  *
22343  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22344  */
22345  __pyx_tuple__29 = PyTuple_New(1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 579, __pyx_L1_error)
22346  __Pyx_GOTREF(__pyx_tuple__29);
22347  __Pyx_INCREF(__pyx_int_neg_1);
22348  __Pyx_GIVEREF(__pyx_int_neg_1);
22349  PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
22350  __Pyx_GIVEREF(__pyx_tuple__29);
22351 
22352  /* "(tree fragment)":2
22353  * def __reduce_cython__(self):
22354  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22355  * def __setstate_cython__(self, __pyx_state):
22356  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22357  */
22358  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
22359  __Pyx_GOTREF(__pyx_tuple__30);
22360  __Pyx_GIVEREF(__pyx_tuple__30);
22361 
22362  /* "(tree fragment)":4
22363  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22364  * def __setstate_cython__(self, __pyx_state):
22365  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22366  */
22367  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
22368  __Pyx_GOTREF(__pyx_tuple__31);
22369  __Pyx_GIVEREF(__pyx_tuple__31);
22370 
22371  /* "View.MemoryView":684
22372  * if item is Ellipsis:
22373  * if not seen_ellipsis:
22374  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22375  * seen_ellipsis = True
22376  * else:
22377  */
22378  __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 684, __pyx_L1_error)
22379  __Pyx_GOTREF(__pyx_slice__32);
22380  __Pyx_GIVEREF(__pyx_slice__32);
22381 
22382  /* "View.MemoryView":705
22383  * for suboffset in suboffsets[:ndim]:
22384  * if suboffset >= 0:
22385  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22386  *
22387  *
22388  */
22389  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 705, __pyx_L1_error)
22390  __Pyx_GOTREF(__pyx_tuple__33);
22391  __Pyx_GIVEREF(__pyx_tuple__33);
22392 
22393  /* "(tree fragment)":2
22394  * def __reduce_cython__(self):
22395  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22396  * def __setstate_cython__(self, __pyx_state):
22397  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22398  */
22399  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22400  __Pyx_GOTREF(__pyx_tuple__34);
22401  __Pyx_GIVEREF(__pyx_tuple__34);
22402 
22403  /* "(tree fragment)":4
22404  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22405  * def __setstate_cython__(self, __pyx_state):
22406  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22407  */
22408  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22409  __Pyx_GOTREF(__pyx_tuple__35);
22410  __Pyx_GIVEREF(__pyx_tuple__35);
22411  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error)
22412  __Pyx_GOTREF(__pyx_tuple__37);
22413  __Pyx_GIVEREF(__pyx_tuple__37);
22414 
22415  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
22416  * # ======================
22417  *
22418  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
22419  * """
22420  * Sets matrix A.
22421  */
22422  __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_float_mv_c, __pyx_n_s_A_data_float_mv_f, __pyx_n_s_A_data_float); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 216, __pyx_L1_error)
22423  __Pyx_GOTREF(__pyx_tuple__38);
22424  __Pyx_GIVEREF(__pyx_tuple__38);
22425  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_float, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 216, __pyx_L1_error)
22426 
22427  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
22428  * # =======================
22429  *
22430  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
22431  * """
22432  * Sets matrix A.
22433  */
22434  __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_double_mv_c, __pyx_n_s_A_data_double_mv_f, __pyx_n_s_A_data_double); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 272, __pyx_L1_error)
22435  __Pyx_GOTREF(__pyx_tuple__39);
22436  __Pyx_GIVEREF(__pyx_tuple__39);
22437  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_double, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 272, __pyx_L1_error)
22438 
22439  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
22440  * # ============================
22441  *
22442  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22443  * """
22444  * Sets matrix A.
22445  */
22446  __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_long_double_mv_c, __pyx_n_s_A_data_long_double_mv_f, __pyx_n_s_A_data_long_double); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 328, __pyx_L1_error)
22447  __Pyx_GOTREF(__pyx_tuple__40);
22448  __Pyx_GIVEREF(__pyx_tuple__40);
22449  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_long_double, 328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 328, __pyx_L1_error)
22450 
22451  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
22452  * # ====================
22453  *
22454  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
22455  * """
22456  * """
22457  */
22458  __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 384, __pyx_L1_error)
22459  __Pyx_GOTREF(__pyx_tuple__41);
22460  __Pyx_GIVEREF(__pyx_tuple__41);
22461  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_float, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 384, __pyx_L1_error)
22462 
22463  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
22464  * # =====================
22465  *
22466  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
22467  * """
22468  * """
22469  */
22470  __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 431, __pyx_L1_error)
22471  __Pyx_GOTREF(__pyx_tuple__42);
22472  __Pyx_GIVEREF(__pyx_tuple__42);
22473  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_double, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 431, __pyx_L1_error)
22474 
22475  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
22476  * # ==========================
22477  *
22478  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22479  * """
22480  * """
22481  */
22482  __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 478, __pyx_L1_error)
22483  __Pyx_GOTREF(__pyx_tuple__43);
22484  __Pyx_GIVEREF(__pyx_tuple__43);
22485  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_long_double, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 478, __pyx_L1_error)
22486 
22487  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
22488  * # ====================
22489  *
22490  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
22491  * """
22492  * """
22493  */
22494  __pyx_tuple__44 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 525, __pyx_L1_error)
22495  __Pyx_GOTREF(__pyx_tuple__44);
22496  __Pyx_GIVEREF(__pyx_tuple__44);
22497  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_float, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 525, __pyx_L1_error)
22498 
22499  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
22500  * # =====================
22501  *
22502  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
22503  * """
22504  * """
22505  */
22506  __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 572, __pyx_L1_error)
22507  __Pyx_GOTREF(__pyx_tuple__45);
22508  __Pyx_GIVEREF(__pyx_tuple__45);
22509  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_double, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 572, __pyx_L1_error)
22510 
22511  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
22512  * # ==========================
22513  *
22514  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22515  * """
22516  * """
22517  */
22518  __pyx_tuple__46 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 619, __pyx_L1_error)
22519  __Pyx_GOTREF(__pyx_tuple__46);
22520  __Pyx_GIVEREF(__pyx_tuple__46);
22521  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_long_double, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 619, __pyx_L1_error)
22522 
22523  /* "(tree fragment)":1
22524  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22525  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22526  * def __setstate_cython__(self, __pyx_state):
22527  */
22528  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 1, __pyx_L1_error)
22529  __Pyx_GOTREF(__pyx_tuple__47);
22530  __Pyx_GIVEREF(__pyx_tuple__47);
22531  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
22532 
22533  /* "(tree fragment)":3
22534  * def __reduce_cython__(self):
22535  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22536  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22537  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22538  */
22539  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 3, __pyx_L1_error)
22540  __Pyx_GOTREF(__pyx_tuple__48);
22541  __Pyx_GIVEREF(__pyx_tuple__48);
22542  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
22543 
22544  /* "View.MemoryView":287
22545  * return self.name
22546  *
22547  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22548  * cdef strided = Enum("<strided and direct>") # default
22549  * cdef indirect = Enum("<strided and indirect>")
22550  */
22551  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
22552  __Pyx_GOTREF(__pyx_tuple__49);
22553  __Pyx_GIVEREF(__pyx_tuple__49);
22554 
22555  /* "View.MemoryView":288
22556  *
22557  * cdef generic = Enum("<strided and direct or indirect>")
22558  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22559  * cdef indirect = Enum("<strided and indirect>")
22560  *
22561  */
22562  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
22563  __Pyx_GOTREF(__pyx_tuple__50);
22564  __Pyx_GIVEREF(__pyx_tuple__50);
22565 
22566  /* "View.MemoryView":289
22567  * cdef generic = Enum("<strided and direct or indirect>")
22568  * cdef strided = Enum("<strided and direct>") # default
22569  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22570  *
22571  *
22572  */
22573  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 289, __pyx_L1_error)
22574  __Pyx_GOTREF(__pyx_tuple__51);
22575  __Pyx_GIVEREF(__pyx_tuple__51);
22576 
22577  /* "View.MemoryView":292
22578  *
22579  *
22580  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22581  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22582  *
22583  */
22584  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
22585  __Pyx_GOTREF(__pyx_tuple__52);
22586  __Pyx_GIVEREF(__pyx_tuple__52);
22587 
22588  /* "View.MemoryView":293
22589  *
22590  * cdef contiguous = Enum("<contiguous and direct>")
22591  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22592  *
22593  *
22594  */
22595  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 293, __pyx_L1_error)
22596  __Pyx_GOTREF(__pyx_tuple__53);
22597  __Pyx_GIVEREF(__pyx_tuple__53);
22598 
22599  /* "(tree fragment)":1
22600  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22601  * cdef object __pyx_PickleError
22602  * cdef object __pyx_result
22603  */
22604  __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error)
22605  __Pyx_GOTREF(__pyx_tuple__54);
22606  __Pyx_GIVEREF(__pyx_tuple__54);
22607  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22608  __Pyx_RefNannyFinishContext();
22609  return 0;
22610  __pyx_L1_error:;
22611  __Pyx_RefNannyFinishContext();
22612  return -1;
22613 }
22614 
22615 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22616  /* AssertionsEnabled.init */
22617  __Pyx_init_assertions_enabled();
22618 
22619 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
22620 
22621  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22622  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22623  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22624  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22625  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
22626  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
22627  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22628  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22629  return 0;
22630  __pyx_L1_error:;
22631  return -1;
22632 }
22633 
22634 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22635 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22636 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22637 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22638 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22639 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22640 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22641 
22642 static int __Pyx_modinit_global_init_code(void) {
22643  __Pyx_RefNannyDeclarations
22644  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22645  /*--- Global init code ---*/
22646  generic = Py_None; Py_INCREF(Py_None);
22647  strided = Py_None; Py_INCREF(Py_None);
22648  indirect = Py_None; Py_INCREF(Py_None);
22649  contiguous = Py_None; Py_INCREF(Py_None);
22650  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22651  __Pyx_RefNannyFinishContext();
22652  return 0;
22653 }
22654 
22655 static int __Pyx_modinit_variable_export_code(void) {
22656  __Pyx_RefNannyDeclarations
22657  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22658  /*--- Variable export code ---*/
22659  __Pyx_RefNannyFinishContext();
22660  return 0;
22661 }
22662 
22663 static int __Pyx_modinit_function_export_code(void) {
22664  __Pyx_RefNannyDeclarations
22665  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22666  /*--- Function export code ---*/
22667  __Pyx_RefNannyFinishContext();
22668  return 0;
22669 }
22670 
22671 static int __Pyx_modinit_type_init_code(void) {
22672  __Pyx_RefNannyDeclarations
22673  PyObject *__pyx_t_1 = NULL;
22674  int __pyx_lineno = 0;
22675  const char *__pyx_filename = NULL;
22676  int __pyx_clineno = 0;
22677  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22678  /*--- Type init code ---*/
22679  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22680  __Pyx_GOTREF(__pyx_t_1);
22681  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
22682  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
22683  __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22684  __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22685  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22686  if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22687  #if PY_VERSION_HEX < 0x030800B1
22688  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_print = 0;
22689  #endif
22690  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22691  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22692  }
22693  if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22694  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycMatrix, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22695  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22696  __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22697  __pyx_vtabptr_array = &__pyx_vtable_array;
22698  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22699  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22700  #if PY_VERSION_HEX < 0x030800B1
22701  __pyx_type___pyx_array.tp_print = 0;
22702  #endif
22703  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22704  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22705  __pyx_array_type = &__pyx_type___pyx_array;
22706  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22707  #if PY_VERSION_HEX < 0x030800B1
22708  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22709  #endif
22710  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22711  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22712  }
22713  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22714  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22715  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22716  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22717  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22718  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22719  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22720  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22721  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22722  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22723  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22724  #if PY_VERSION_HEX < 0x030800B1
22725  __pyx_type___pyx_memoryview.tp_print = 0;
22726  #endif
22727  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22728  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22729  }
22730  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22731  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22732  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22733  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22734  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22735  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22736  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22737  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22738  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22739  #if PY_VERSION_HEX < 0x030800B1
22740  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22741  #endif
22742  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22743  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22744  }
22745  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22746  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22747  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22748  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22749  __Pyx_RefNannyFinishContext();
22750  return 0;
22751  __pyx_L1_error:;
22752  __Pyx_XDECREF(__pyx_t_1);
22753  __Pyx_RefNannyFinishContext();
22754  return -1;
22755 }
22756 
22757 static int __Pyx_modinit_type_import_code(void) {
22758  __Pyx_RefNannyDeclarations
22759  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22760  /*--- Type import code ---*/
22761  __Pyx_RefNannyFinishContext();
22762  return 0;
22763 }
22764 
22765 static int __Pyx_modinit_variable_import_code(void) {
22766  __Pyx_RefNannyDeclarations
22767  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22768  /*--- Variable import code ---*/
22769  __Pyx_RefNannyFinishContext();
22770  return 0;
22771 }
22772 
22773 static int __Pyx_modinit_function_import_code(void) {
22774  __Pyx_RefNannyDeclarations
22775  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22776  /*--- Function import code ---*/
22777  __Pyx_RefNannyFinishContext();
22778  return 0;
22779 }
22780 
22781 
22782 #ifndef CYTHON_NO_PYINIT_EXPORT
22783 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22784 #elif PY_MAJOR_VERSION < 3
22785 #ifdef __cplusplus
22786 #define __Pyx_PyMODINIT_FUNC extern "C" void
22787 #else
22788 #define __Pyx_PyMODINIT_FUNC void
22789 #endif
22790 #else
22791 #ifdef __cplusplus
22792 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22793 #else
22794 #define __Pyx_PyMODINIT_FUNC PyObject *
22795 #endif
22796 #endif
22797 
22798 
22799 #if PY_MAJOR_VERSION < 3
22800 __Pyx_PyMODINIT_FUNC initpy_c_matrix(void) CYTHON_SMALL_CODE; /*proto*/
22801 __Pyx_PyMODINIT_FUNC initpy_c_matrix(void)
22802 #else
22803 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void) CYTHON_SMALL_CODE; /*proto*/
22804 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)
22805 #if CYTHON_PEP489_MULTI_PHASE_INIT
22806 {
22807  return PyModuleDef_Init(&__pyx_moduledef);
22808 }
22809 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
22810  #if PY_VERSION_HEX >= 0x030700A1
22811  static PY_INT64_T main_interpreter_id = -1;
22812  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22813  if (main_interpreter_id == -1) {
22814  main_interpreter_id = current_id;
22815  return (unlikely(current_id == -1)) ? -1 : 0;
22816  } else if (unlikely(main_interpreter_id != current_id))
22817  #else
22818  static PyInterpreterState *main_interpreter = NULL;
22819  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22820  if (!main_interpreter) {
22821  main_interpreter = current_interpreter;
22822  } else if (unlikely(main_interpreter != current_interpreter))
22823  #endif
22824  {
22825  PyErr_SetString(
22826  PyExc_ImportError,
22827  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22828  return -1;
22829  }
22830  return 0;
22831 }
22832 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
22833  PyObject *value = PyObject_GetAttrString(spec, from_name);
22834  int result = 0;
22835  if (likely(value)) {
22836  if (allow_none || value != Py_None) {
22837  result = PyDict_SetItemString(moddict, to_name, value);
22838  }
22839  Py_DECREF(value);
22840  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22841  PyErr_Clear();
22842  } else {
22843  result = -1;
22844  }
22845  return result;
22846 }
22847 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22848  PyObject *module = NULL, *moddict, *modname;
22849  if (__Pyx_check_single_interpreter())
22850  return NULL;
22851  if (__pyx_m)
22852  return __Pyx_NewRef(__pyx_m);
22853  modname = PyObject_GetAttrString(spec, "name");
22854  if (unlikely(!modname)) goto bad;
22855  module = PyModule_NewObject(modname);
22856  Py_DECREF(modname);
22857  if (unlikely(!module)) goto bad;
22858  moddict = PyModule_GetDict(module);
22859  if (unlikely(!moddict)) goto bad;
22860  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
22861  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
22862  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
22863  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
22864  return module;
22865 bad:
22866  Py_XDECREF(module);
22867  return NULL;
22868 }
22869 
22870 
22871 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_matrix(PyObject *__pyx_pyinit_module)
22872 #endif
22873 #endif
22874 {
22875  __Pyx_TraceDeclarations
22876  PyObject *__pyx_t_1 = NULL;
22877  PyObject *__pyx_t_2 = NULL;
22878  static PyThread_type_lock __pyx_t_3[8];
22879  int __pyx_lineno = 0;
22880  const char *__pyx_filename = NULL;
22881  int __pyx_clineno = 0;
22882  __Pyx_RefNannyDeclarations
22883  #if CYTHON_PEP489_MULTI_PHASE_INIT
22884  if (__pyx_m) {
22885  if (__pyx_m == __pyx_pyinit_module) return 0;
22886  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_matrix' has already been imported. Re-initialisation is not supported.");
22887  return -1;
22888  }
22889  #elif PY_MAJOR_VERSION >= 3
22890  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22891  #endif
22892  #if CYTHON_REFNANNY
22893 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22894 if (!__Pyx_RefNanny) {
22895  PyErr_Clear();
22896  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22897  if (!__Pyx_RefNanny)
22898  Py_FatalError("failed to import 'refnanny' module");
22899 }
22900 #endif
22901  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", 0);
22902  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22903  #ifdef __Pxy_PyFrame_Initialize_Offsets
22904  __Pxy_PyFrame_Initialize_Offsets();
22905  #endif
22906  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22907  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22908  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22909  #ifdef __Pyx_CyFunction_USED
22910  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22911  #endif
22912  #ifdef __Pyx_FusedFunction_USED
22913  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22914  #endif
22915  #ifdef __Pyx_Coroutine_USED
22916  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22917  #endif
22918  #ifdef __Pyx_Generator_USED
22919  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22920  #endif
22921  #ifdef __Pyx_AsyncGen_USED
22922  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22923  #endif
22924  #ifdef __Pyx_StopAsyncIteration_USED
22925  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22926  #endif
22927  /*--- Library function declarations ---*/
22928  /*--- Threads initialization code ---*/
22929  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22930  PyEval_InitThreads();
22931  #endif
22932  /*--- Module creation code ---*/
22933  #if CYTHON_PEP489_MULTI_PHASE_INIT
22934  __pyx_m = __pyx_pyinit_module;
22935  Py_INCREF(__pyx_m);
22936  #else
22937  #if PY_MAJOR_VERSION < 3
22938  __pyx_m = Py_InitModule4("py_c_matrix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22939  #else
22940  __pyx_m = PyModule_Create(&__pyx_moduledef);
22941  #endif
22942  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22943  #endif
22944  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22945  Py_INCREF(__pyx_d);
22946  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22947  Py_INCREF(__pyx_b);
22948  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22949  Py_INCREF(__pyx_cython_runtime);
22950  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22951  /*--- Initialize various global constants etc. ---*/
22952  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22953  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22954  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22955  #endif
22956  if (__pyx_module_is_main_imate___c_linear_operator__py_c_matrix) {
22957  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22958  }
22959  #if PY_MAJOR_VERSION >= 3
22960  {
22961  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22962  if (!PyDict_GetItemString(modules, "imate._c_linear_operator.py_c_matrix")) {
22963  if (unlikely(PyDict_SetItemString(modules, "imate._c_linear_operator.py_c_matrix", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22964  }
22965  }
22966  #endif
22967  /*--- Builtin init code ---*/
22968  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22969  /*--- Constants init code ---*/
22970  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22971  /*--- Global type/function init code ---*/
22972  (void)__Pyx_modinit_global_init_code();
22973  (void)__Pyx_modinit_variable_export_code();
22974  (void)__Pyx_modinit_function_export_code();
22975  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22976  (void)__Pyx_modinit_type_import_code();
22977  (void)__Pyx_modinit_variable_import_code();
22978  (void)__Pyx_modinit_function_import_code();
22979  /*--- Execution code ---*/
22980  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22981  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22982  #endif
22983  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
22984 
22985  /* "imate/_c_linear_operator/py_c_matrix.pyx":15
22986  *
22987  * # Python
22988  * import numpy # <<<<<<<<<<<<<<
22989  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix
22990  *
22991  */
22992  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
22993  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
22994  __Pyx_GOTREF(__pyx_t_1);
22995  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22996  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22997 
22998  /* "imate/_c_linear_operator/py_c_matrix.pyx":16
22999  * # Python
23000  * import numpy
23001  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix # <<<<<<<<<<<<<<
23002  *
23003  * # Cython
23004  */
23005  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
23006  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23007  __Pyx_GOTREF(__pyx_t_1);
23008  __Pyx_INCREF(__pyx_n_s_issparse);
23009  __Pyx_GIVEREF(__pyx_n_s_issparse);
23010  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
23011  __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
23012  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
23013  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
23014  __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
23015  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
23016  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
23017  __Pyx_INCREF(__pyx_n_s_csr_matrix);
23018  __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
23019  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
23020  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
23021  __Pyx_GOTREF(__pyx_t_2);
23022  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23023  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23024  __Pyx_GOTREF(__pyx_t_1);
23025  if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23026  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23027  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23028  __Pyx_GOTREF(__pyx_t_1);
23029  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23030  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23031  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23032  __Pyx_GOTREF(__pyx_t_1);
23033  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23034  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23035  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23036  __Pyx_GOTREF(__pyx_t_1);
23037  if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23038  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23039  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23040 
23041  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
23042  * # ======================
23043  *
23044  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
23045  * """
23046  * Sets matrix A.
23047  */
23048  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
23049  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
23050  __Pyx_GOTREF(__pyx_t_2);
23051  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
23052  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23053  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23054 
23055  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
23056  * # =======================
23057  *
23058  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
23059  * """
23060  * Sets matrix A.
23061  */
23062  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
23063  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_doubl, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
23064  __Pyx_GOTREF(__pyx_t_2);
23065  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
23066  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23067  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23068 
23069  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
23070  * # ============================
23071  *
23072  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
23073  * """
23074  * Sets matrix A.
23075  */
23076  __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
23077  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_long, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
23078  __Pyx_GOTREF(__pyx_t_2);
23079  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
23080  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23081  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23082 
23083  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
23084  * # ====================
23085  *
23086  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
23087  * """
23088  * """
23089  */
23090  __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
23091  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
23092  __Pyx_GOTREF(__pyx_t_2);
23093  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
23094  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23095  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23096 
23097  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
23098  * # =====================
23099  *
23100  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
23101  * """
23102  * """
23103  */
23104  __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
23105  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
23106  __Pyx_GOTREF(__pyx_t_2);
23107  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
23108  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23109  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23110 
23111  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
23112  * # ==========================
23113  *
23114  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
23115  * """
23116  * """
23117  */
23118  __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error))
23119  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
23120  __Pyx_GOTREF(__pyx_t_2);
23121  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
23122  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23123  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23124 
23125  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
23126  * # ====================
23127  *
23128  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
23129  * """
23130  * """
23131  */
23132  __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
23133  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
23134  __Pyx_GOTREF(__pyx_t_2);
23135  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
23136  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23137  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23138 
23139  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
23140  * # =====================
23141  *
23142  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
23143  * """
23144  * """
23145  */
23146  __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
23147  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
23148  __Pyx_GOTREF(__pyx_t_2);
23149  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
23150  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23151  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23152 
23153  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
23154  * # ==========================
23155  *
23156  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
23157  * """
23158  * """
23159  */
23160  __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error))
23161  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
23162  __Pyx_GOTREF(__pyx_t_2);
23163  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
23164  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23165  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23166 
23167  /* "(tree fragment)":1
23168  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23169  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23170  * def __setstate_cython__(self, __pyx_state):
23171  */
23172  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23173  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___reduce_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23174  __Pyx_GOTREF(__pyx_t_2);
23175  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23176  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23177 
23178  /* "(tree fragment)":3
23179  * def __reduce_cython__(self):
23180  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23181  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23182  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23183  */
23184  __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
23185  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___setstate_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
23186  __Pyx_GOTREF(__pyx_t_2);
23187  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23188  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23189 
23190  /* "imate/_c_linear_operator/py_c_matrix.pyx":1
23191  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
23192  * # SPDX-License-Identifier: BSD-3-Clause
23193  * # SPDX-FileType: SOURCE
23194  */
23195  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
23196  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23197  __Pyx_GOTREF(__pyx_t_2);
23198  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23199  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23200 
23201  /* "View.MemoryView":210
23202  * info.obj = self
23203  *
23204  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23205  *
23206  * def __dealloc__(array self):
23207  */
23208  __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
23209  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
23210  __Pyx_GOTREF(__pyx_t_2);
23211  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
23212  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23213  PyType_Modified(__pyx_array_type);
23214 
23215  /* "View.MemoryView":227
23216  *
23217  * @cname('get_memview')
23218  * cdef get_memview(self): # <<<<<<<<<<<<<<
23219  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
23220  * return memoryview(self, flags, self.dtype_is_object)
23221  */
23222  __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
23223 
23224 
23225  /* "View.MemoryView":245
23226  *
23227  * @cname("__pyx_array_new")
23228  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
23229  * char *mode, char *buf):
23230  * cdef array result
23231  */
23232  __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
23233 
23234 
23235  /* "View.MemoryView":287
23236  * return self.name
23237  *
23238  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23239  * cdef strided = Enum("<strided and direct>") # default
23240  * cdef indirect = Enum("<strided and indirect>")
23241  */
23242  __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
23243  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
23244  __Pyx_GOTREF(__pyx_t_2);
23245  __Pyx_XGOTREF(generic);
23246  __Pyx_DECREF_SET(generic, __pyx_t_2);
23247  __Pyx_GIVEREF(__pyx_t_2);
23248  __pyx_t_2 = 0;
23249 
23250  /* "View.MemoryView":288
23251  *
23252  * cdef generic = Enum("<strided and direct or indirect>")
23253  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23254  * cdef indirect = Enum("<strided and indirect>")
23255  *
23256  */
23257  __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
23258  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
23259  __Pyx_GOTREF(__pyx_t_2);
23260  __Pyx_XGOTREF(strided);
23261  __Pyx_DECREF_SET(strided, __pyx_t_2);
23262  __Pyx_GIVEREF(__pyx_t_2);
23263  __pyx_t_2 = 0;
23264 
23265  /* "View.MemoryView":289
23266  * cdef generic = Enum("<strided and direct or indirect>")
23267  * cdef strided = Enum("<strided and direct>") # default
23268  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23269  *
23270  *
23271  */
23272  __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
23273  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
23274  __Pyx_GOTREF(__pyx_t_2);
23275  __Pyx_XGOTREF(indirect);
23276  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23277  __Pyx_GIVEREF(__pyx_t_2);
23278  __pyx_t_2 = 0;
23279 
23280  /* "View.MemoryView":292
23281  *
23282  *
23283  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23284  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23285  *
23286  */
23287  __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
23288  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
23289  __Pyx_GOTREF(__pyx_t_2);
23290  __Pyx_XGOTREF(contiguous);
23291  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23292  __Pyx_GIVEREF(__pyx_t_2);
23293  __pyx_t_2 = 0;
23294 
23295  /* "View.MemoryView":293
23296  *
23297  * cdef contiguous = Enum("<contiguous and direct>")
23298  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23299  *
23300  *
23301  */
23302  __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
23303  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
23304  __Pyx_GOTREF(__pyx_t_2);
23305  __Pyx_XGOTREF(indirect_contiguous);
23306  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23307  __Pyx_GIVEREF(__pyx_t_2);
23308  __pyx_t_2 = 0;
23309 
23310  /* "View.MemoryView":299
23311  *
23312  * @cname('__pyx_align_pointer')
23313  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
23314  * "Align pointer memory on a given boundary"
23315  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
23316  */
23317  __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
23318 
23319 
23320  /* "View.MemoryView":317
23321  *
23322  * DEF THREAD_LOCKS_PREALLOCATED = 8
23323  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23324  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23325  * PyThread_allocate_lock(),
23326  */
23327  __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
23328  __pyx_memoryview_thread_locks_used = 0;
23329 
23330  /* "View.MemoryView":318
23331  * DEF THREAD_LOCKS_PREALLOCATED = 8
23332  * cdef int __pyx_memoryview_thread_locks_used = 0
23333  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23334  * PyThread_allocate_lock(),
23335  * PyThread_allocate_lock(),
23336  */
23337  __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
23338  __pyx_t_3[0] = PyThread_allocate_lock();
23339  __pyx_t_3[1] = PyThread_allocate_lock();
23340  __pyx_t_3[2] = PyThread_allocate_lock();
23341  __pyx_t_3[3] = PyThread_allocate_lock();
23342  __pyx_t_3[4] = PyThread_allocate_lock();
23343  __pyx_t_3[5] = PyThread_allocate_lock();
23344  __pyx_t_3[6] = PyThread_allocate_lock();
23345  __pyx_t_3[7] = PyThread_allocate_lock();
23346  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23347 
23348  /* "View.MemoryView":395
23349  * PyThread_free_lock(self.lock)
23350  *
23351  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
23352  * cdef Py_ssize_t dim
23353  * cdef char *itemp = <char *> self.view.buf
23354  */
23355  __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
23356 
23357 
23358  /* "View.MemoryView":433
23359  * self.setitem_indexed(index, value)
23360  *
23361  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
23362  * if not isinstance(obj, memoryview):
23363  * try:
23364  */
23365  __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
23366 
23367 
23368  /* "View.MemoryView":443
23369  * return obj
23370  *
23371  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
23372  * cdef __Pyx_memviewslice dst_slice
23373  * cdef __Pyx_memviewslice src_slice
23374  */
23375  __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
23376 
23377 
23378  /* "View.MemoryView":451
23379  * src.ndim, dst.ndim, self.dtype_is_object)
23380  *
23381  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
23382  * cdef int array[128]
23383  * cdef void *tmp = NULL
23384  */
23385  __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
23386 
23387 
23388  /* "View.MemoryView":483
23389  * PyMem_Free(tmp)
23390  *
23391  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
23392  * cdef char *itemp = self.get_item_pointer(index)
23393  * self.assign_item_from_object(itemp, value)
23394  */
23395  __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
23396 
23397 
23398  /* "View.MemoryView":487
23399  * self.assign_item_from_object(itemp, value)
23400  *
23401  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
23402  * """Only used if instantiated manually by the user, or if Cython doesn't
23403  * know how to convert the type"""
23404  */
23405  __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
23406 
23407 
23408  /* "View.MemoryView":503
23409  * return result
23410  *
23411  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
23412  * """Only used if instantiated manually by the user, or if Cython doesn't
23413  * know how to convert the type"""
23414  */
23415  __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
23416 
23417 
23418  /* "View.MemoryView":551
23419  * info.obj = self
23420  *
23421  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23422  *
23423  *
23424  */
23425  __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
23426  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
23427  __Pyx_GOTREF(__pyx_t_2);
23428  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
23429  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23430  PyType_Modified(__pyx_memoryview_type);
23431 
23432  /* "View.MemoryView":659
23433  *
23434  * @cname('__pyx_memoryview_new')
23435  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
23436  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
23437  * result.typeinfo = typeinfo
23438  */
23439  __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
23440 
23441 
23442  /* "View.MemoryView":665
23443  *
23444  * @cname('__pyx_memoryview_check')
23445  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
23446  * return isinstance(o, memoryview)
23447  *
23448  */
23449  __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
23450 
23451 
23452  /* "View.MemoryView":668
23453  * return isinstance(o, memoryview)
23454  *
23455  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
23456  * """
23457  * Replace all ellipses with full slices and fill incomplete indices with
23458  */
23459  __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
23460 
23461 
23462  /* "View.MemoryView":702
23463  * return have_slices or nslices, tuple(result)
23464  *
23465  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
23466  * for suboffset in suboffsets[:ndim]:
23467  * if suboffset >= 0:
23468  */
23469  __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
23470 
23471 
23472  /* "View.MemoryView":712
23473  *
23474  * @cname('__pyx_memview_slice')
23475  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
23476  * cdef int new_ndim = 0, suboffset_dim = -1, dim
23477  * cdef bint negative_step
23478  */
23479  __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
23480 
23481 
23482  /* "View.MemoryView":809
23483  *
23484  * @cname('__pyx_memoryview_slice_memviewslice')
23485  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
23486  * __Pyx_memviewslice *dst,
23487  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
23488  */
23489  __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
23490 
23491 
23492  /* "View.MemoryView":912
23493  *
23494  * @cname('__pyx_pybuffer_index')
23495  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
23496  * Py_ssize_t dim) except NULL:
23497  * cdef Py_ssize_t shape, stride, suboffset = -1
23498  */
23499  __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
23500 
23501 
23502  /* "View.MemoryView":945
23503  *
23504  * @cname('__pyx_memslice_transpose')
23505  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
23506  * cdef int ndim = memslice.memview.view.ndim
23507  *
23508  */
23509  __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
23510 
23511 
23512  /* "View.MemoryView":981
23513  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
23514  *
23515  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
23516  * if self.to_object_func != NULL:
23517  * return self.to_object_func(itemp)
23518  */
23519  __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
23520 
23521 
23522  /* "View.MemoryView":987
23523  * return memoryview.convert_item_to_object(self, itemp)
23524  *
23525  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
23526  * if self.to_dtype_func != NULL:
23527  * self.to_dtype_func(itemp, value)
23528  */
23529  __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
23530 
23531 
23532  /* "View.MemoryView":997
23533  * return self.from_object
23534  *
23535  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23536  *
23537  *
23538  */
23539  __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
23540  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
23541  __Pyx_GOTREF(__pyx_t_2);
23542  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
23543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23544  PyType_Modified(__pyx_memoryviewslice_type);
23545 
23546  /* "View.MemoryView":1001
23547  *
23548  * @cname('__pyx_memoryview_fromslice')
23549  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
23550  * int ndim,
23551  * object (*to_object_func)(char *),
23552  */
23553  __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
23554 
23555 
23556  /* "View.MemoryView":1054
23557  *
23558  * @cname('__pyx_memoryview_get_slice_from_memoryview')
23559  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
23560  * __Pyx_memviewslice *mslice) except NULL:
23561  * cdef _memoryviewslice obj
23562  */
23563  __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
23564 
23565 
23566  /* "View.MemoryView":1065
23567  *
23568  * @cname('__pyx_memoryview_slice_copy')
23569  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
23570  * cdef int dim
23571  * cdef (Py_ssize_t*) shape, strides, suboffsets
23572  */
23573  __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
23574 
23575 
23576  /* "View.MemoryView":1082
23577  *
23578  * @cname('__pyx_memoryview_copy_object')
23579  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
23580  * "Create a new memoryview object"
23581  * cdef __Pyx_memviewslice memviewslice
23582  */
23583  __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
23584 
23585 
23586  /* "View.MemoryView":1089
23587  *
23588  * @cname('__pyx_memoryview_copy_object_from_slice')
23589  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
23590  * """
23591  * Create a new memoryview object from a given memoryview object and slice.
23592  */
23593  __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
23594 
23595 
23596  /* "View.MemoryView":1111
23597  *
23598  *
23599  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
23600  * if arg < 0:
23601  * return -arg
23602  */
23603  __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
23604 
23605 
23606  /* "View.MemoryView":1118
23607  *
23608  * @cname('__pyx_get_best_slice_order')
23609  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
23610  * """
23611  * Figure out the best memory access order for a given slice.
23612  */
23613  __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
23614 
23615 
23616  /* "View.MemoryView":1172
23617  * dst_data += dst_stride
23618  *
23619  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23620  * __Pyx_memviewslice *dst,
23621  * int ndim, size_t itemsize) nogil:
23622  */
23623  __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
23624 
23625 
23626  /* "View.MemoryView":1179
23627  *
23628  * @cname('__pyx_memoryview_slice_get_size')
23629  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
23630  * "Return the size of the memory occupied by the slice in number of bytes"
23631  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
23632  */
23633  __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
23634 
23635 
23636  /* "View.MemoryView":1189
23637  *
23638  * @cname('__pyx_fill_contig_strides_array')
23639  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
23640  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23641  * int ndim, char order) nogil:
23642  */
23643  __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
23644 
23645 
23646  /* "View.MemoryView":1210
23647  *
23648  * @cname('__pyx_memoryview_copy_data_to_temp')
23649  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23650  * __Pyx_memviewslice *tmpslice,
23651  * char order,
23652  */
23653  __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
23654 
23655 
23656  /* "View.MemoryView":1253
23657  *
23658  * @cname('__pyx_memoryview_err_extents')
23659  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23660  * Py_ssize_t extent2) except -1 with gil:
23661  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23662  */
23663  __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
23664 
23665 
23666  /* "View.MemoryView":1259
23667  *
23668  * @cname('__pyx_memoryview_err_dim')
23669  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23670  * raise error(msg.decode('ascii') % dim)
23671  *
23672  */
23673  __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
23674 
23675 
23676  /* "View.MemoryView":1263
23677  *
23678  * @cname('__pyx_memoryview_err')
23679  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23680  * if msg != NULL:
23681  * raise error(msg.decode('ascii'))
23682  */
23683  __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23684 
23685 
23686  /* "View.MemoryView":1270
23687  *
23688  * @cname('__pyx_memoryview_copy_contents')
23689  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
23690  * __Pyx_memviewslice dst,
23691  * int src_ndim, int dst_ndim,
23692  */
23693  __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
23694 
23695 
23696  /* "View.MemoryView":1342
23697  *
23698  * @cname('__pyx_memoryview_broadcast_leading')
23699  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
23700  * int ndim,
23701  * int ndim_other) nogil:
23702  */
23703  __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
23704 
23705 
23706  /* "View.MemoryView":1364
23707  *
23708  * @cname('__pyx_memoryview_refcount_copying')
23709  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
23710  * int ndim, bint inc) nogil:
23711  *
23712  */
23713  __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
23714 
23715 
23716  /* "View.MemoryView":1373
23717  *
23718  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23719  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23720  * Py_ssize_t *strides, int ndim,
23721  * bint inc) with gil:
23722  */
23723  __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
23724 
23725 
23726  /* "View.MemoryView":1379
23727  *
23728  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23729  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23730  * Py_ssize_t *strides, int ndim, bint inc):
23731  * cdef Py_ssize_t i
23732  */
23733  __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
23734 
23735 
23736  /* "View.MemoryView":1399
23737  *
23738  * @cname('__pyx_memoryview_slice_assign_scalar')
23739  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
23740  * size_t itemsize, void *item,
23741  * bint dtype_is_object) nogil:
23742  */
23743  __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
23744 
23745 
23746  /* "View.MemoryView":1409
23747  *
23748  * @cname('__pyx_memoryview__slice_assign_scalar')
23749  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23750  * Py_ssize_t *strides, int ndim,
23751  * size_t itemsize, void *item) nogil:
23752  */
23753  __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
23754 
23755 
23756  /* "(tree fragment)":1
23757  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23758  * cdef object __pyx_PickleError
23759  * cdef object __pyx_result
23760  */
23761  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23762  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23763  __Pyx_GOTREF(__pyx_t_2);
23764  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23765  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23766 
23767  /* "(tree fragment)":11
23768  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23769  * return __pyx_result
23770  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23771  * __pyx_result.name = __pyx_state[0]
23772  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23773  */
23774  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23775 
23776  __Pyx_TraceReturn(Py_None, 0);
23777 
23778  /*--- Wrapped vars code ---*/
23779 
23780  goto __pyx_L0;
23781  __pyx_L1_error:;
23782  __Pyx_XDECREF(__pyx_t_1);
23783  __Pyx_XDECREF(__pyx_t_2);
23784  if (__pyx_m) {
23785  if (__pyx_d) {
23786  __Pyx_AddTraceback("init imate._c_linear_operator.py_c_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
23787  }
23788  Py_CLEAR(__pyx_m);
23789  } else if (!PyErr_Occurred()) {
23790  PyErr_SetString(PyExc_ImportError, "init imate._c_linear_operator.py_c_matrix");
23791  }
23792  __pyx_L0:;
23793  __Pyx_RefNannyFinishContext();
23794  #if CYTHON_PEP489_MULTI_PHASE_INIT
23795  return (__pyx_m != NULL) ? 0 : -1;
23796  #elif PY_MAJOR_VERSION >= 3
23797  return __pyx_m;
23798  #else
23799  return;
23800  #endif
23801 }
23802 
23803 /* --- Runtime support code --- */
23804 /* Refnanny */
23805 #if CYTHON_REFNANNY
23806 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23807  PyObject *m = NULL, *p = NULL;
23808  void *r = NULL;
23809  m = PyImport_ImportModule(modname);
23810  if (!m) goto end;
23811  p = PyObject_GetAttrString(m, "RefNannyAPI");
23812  if (!p) goto end;
23813  r = PyLong_AsVoidPtr(p);
23814 end:
23815  Py_XDECREF(p);
23816  Py_XDECREF(m);
23817  return (__Pyx_RefNannyAPIStruct *)r;
23818 }
23819 #endif
23820 
23821 /* PyObjectGetAttrStr */
23822 #if CYTHON_USE_TYPE_SLOTS
23823 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23824  PyTypeObject* tp = Py_TYPE(obj);
23825  if (likely(tp->tp_getattro))
23826  return tp->tp_getattro(obj, attr_name);
23827 #if PY_MAJOR_VERSION < 3
23828  if (likely(tp->tp_getattr))
23829  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23830 #endif
23831  return PyObject_GetAttr(obj, attr_name);
23832 }
23833 #endif
23834 
23835 /* GetBuiltinName */
23836 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23837  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23838  if (unlikely(!result)) {
23839  PyErr_Format(PyExc_NameError,
23840 #if PY_MAJOR_VERSION >= 3
23841  "name '%U' is not defined", name);
23842 #else
23843  "name '%.200s' is not defined", PyString_AS_STRING(name));
23844 #endif
23845  }
23846  return result;
23847 }
23848 
23849 /* RaiseDoubleKeywords */
23850 static void __Pyx_RaiseDoubleKeywordsError(
23851  const char* func_name,
23852  PyObject* kw_name)
23853 {
23854  PyErr_Format(PyExc_TypeError,
23855  #if PY_MAJOR_VERSION >= 3
23856  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23857  #else
23858  "%s() got multiple values for keyword argument '%s'", func_name,
23859  PyString_AsString(kw_name));
23860  #endif
23861 }
23862 
23863 /* ParseKeywords */
23864 static int __Pyx_ParseOptionalKeywords(
23865  PyObject *kwds,
23866  PyObject **argnames[],
23867  PyObject *kwds2,
23868  PyObject *values[],
23869  Py_ssize_t num_pos_args,
23870  const char* function_name)
23871 {
23872  PyObject *key = 0, *value = 0;
23873  Py_ssize_t pos = 0;
23874  PyObject*** name;
23875  PyObject*** first_kw_arg = argnames + num_pos_args;
23876  while (PyDict_Next(kwds, &pos, &key, &value)) {
23877  name = first_kw_arg;
23878  while (*name && (**name != key)) name++;
23879  if (*name) {
23880  values[name-argnames] = value;
23881  continue;
23882  }
23883  name = first_kw_arg;
23884  #if PY_MAJOR_VERSION < 3
23885  if (likely(PyString_Check(key))) {
23886  while (*name) {
23887  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23888  && _PyString_Eq(**name, key)) {
23889  values[name-argnames] = value;
23890  break;
23891  }
23892  name++;
23893  }
23894  if (*name) continue;
23895  else {
23896  PyObject*** argname = argnames;
23897  while (argname != first_kw_arg) {
23898  if ((**argname == key) || (
23899  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23900  && _PyString_Eq(**argname, key))) {
23901  goto arg_passed_twice;
23902  }
23903  argname++;
23904  }
23905  }
23906  } else
23907  #endif
23908  if (likely(PyUnicode_Check(key))) {
23909  while (*name) {
23910  int cmp = (**name == key) ? 0 :
23911  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23912  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23913  #endif
23914  PyUnicode_Compare(**name, key);
23915  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23916  if (cmp == 0) {
23917  values[name-argnames] = value;
23918  break;
23919  }
23920  name++;
23921  }
23922  if (*name) continue;
23923  else {
23924  PyObject*** argname = argnames;
23925  while (argname != first_kw_arg) {
23926  int cmp = (**argname == key) ? 0 :
23927  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23928  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23929  #endif
23930  PyUnicode_Compare(**argname, key);
23931  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23932  if (cmp == 0) goto arg_passed_twice;
23933  argname++;
23934  }
23935  }
23936  } else
23937  goto invalid_keyword_type;
23938  if (kwds2) {
23939  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23940  } else {
23941  goto invalid_keyword;
23942  }
23943  }
23944  return 0;
23945 arg_passed_twice:
23946  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23947  goto bad;
23948 invalid_keyword_type:
23949  PyErr_Format(PyExc_TypeError,
23950  "%.200s() keywords must be strings", function_name);
23951  goto bad;
23952 invalid_keyword:
23953  PyErr_Format(PyExc_TypeError,
23954  #if PY_MAJOR_VERSION < 3
23955  "%.200s() got an unexpected keyword argument '%.200s'",
23956  function_name, PyString_AsString(key));
23957  #else
23958  "%s() got an unexpected keyword argument '%U'",
23959  function_name, key);
23960  #endif
23961 bad:
23962  return -1;
23963 }
23964 
23965 /* RaiseArgTupleInvalid */
23966 static void __Pyx_RaiseArgtupleInvalid(
23967  const char* func_name,
23968  int exact,
23969  Py_ssize_t num_min,
23970  Py_ssize_t num_max,
23971  Py_ssize_t num_found)
23972 {
23973  Py_ssize_t num_expected;
23974  const char *more_or_less;
23975  if (num_found < num_min) {
23976  num_expected = num_min;
23977  more_or_less = "at least";
23978  } else {
23979  num_expected = num_max;
23980  more_or_less = "at most";
23981  }
23982  if (exact) {
23983  more_or_less = "exactly";
23984  }
23985  PyErr_Format(PyExc_TypeError,
23986  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23987  func_name, more_or_less, num_expected,
23988  (num_expected == 1) ? "" : "s", num_found);
23989 }
23990 
23991 /* PyErrFetchRestore */
23992 #if CYTHON_FAST_THREAD_STATE
23993 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23994  PyObject *tmp_type, *tmp_value, *tmp_tb;
23995  tmp_type = tstate->curexc_type;
23996  tmp_value = tstate->curexc_value;
23997  tmp_tb = tstate->curexc_traceback;
23998  tstate->curexc_type = type;
23999  tstate->curexc_value = value;
24000  tstate->curexc_traceback = tb;
24001  Py_XDECREF(tmp_type);
24002  Py_XDECREF(tmp_value);
24003  Py_XDECREF(tmp_tb);
24004 }
24005 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24006  *type = tstate->curexc_type;
24007  *value = tstate->curexc_value;
24008  *tb = tstate->curexc_traceback;
24009  tstate->curexc_type = 0;
24010  tstate->curexc_value = 0;
24011  tstate->curexc_traceback = 0;
24012 }
24013 #endif
24014 
24015 /* Profile */
24016 #if CYTHON_PROFILE
24017 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24018  PyFrameObject** frame,
24019  PyThreadState* tstate,
24020  const char *funcname,
24021  const char *srcfile,
24022  int firstlineno) {
24023  PyObject *type, *value, *traceback;
24024  int retval;
24025  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24026  if (*code == NULL) {
24027  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24028  if (*code == NULL) return 0;
24029  }
24030  *frame = PyFrame_New(
24031  tstate, /*PyThreadState *tstate*/
24032  *code, /*PyCodeObject *code*/
24033  __pyx_d, /*PyObject *globals*/
24034  0 /*PyObject *locals*/
24035  );
24036  if (*frame == NULL) return 0;
24037  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24038  Py_INCREF(Py_None);
24039  (*frame)->f_trace = Py_None;
24040  }
24041 #if PY_VERSION_HEX < 0x030400B1
24042  } else {
24043  (*frame)->f_tstate = tstate;
24044 #endif
24045  }
24046  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24047  retval = 1;
24048  __Pyx_EnterTracing(tstate);
24049  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24050  #if CYTHON_TRACE
24051  if (tstate->c_tracefunc)
24052  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24053  if (retval && tstate->c_profilefunc)
24054  #endif
24055  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24056  __Pyx_LeaveTracing(tstate);
24057  if (retval) {
24058  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24059  return __Pyx_IsTracing(tstate, 0, 0) && retval;
24060  } else {
24061  Py_XDECREF(type);
24062  Py_XDECREF(value);
24063  Py_XDECREF(traceback);
24064  return -1;
24065  }
24066 }
24067 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
24068  PyCodeObject *py_code = 0;
24069 #if PY_MAJOR_VERSION >= 3
24070  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24071  if (likely(py_code)) {
24072  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24073  }
24074 #else
24075  PyObject *py_srcfile = 0;
24076  PyObject *py_funcname = 0;
24077  py_funcname = PyString_FromString(funcname);
24078  if (unlikely(!py_funcname)) goto bad;
24079  py_srcfile = PyString_FromString(srcfile);
24080  if (unlikely(!py_srcfile)) goto bad;
24081  py_code = PyCode_New(
24082  0,
24083  0,
24084  0,
24085  CO_OPTIMIZED | CO_NEWLOCALS,
24086  __pyx_empty_bytes, /*PyObject *code,*/
24087  __pyx_empty_tuple, /*PyObject *consts,*/
24088  __pyx_empty_tuple, /*PyObject *names,*/
24089  __pyx_empty_tuple, /*PyObject *varnames,*/
24090  __pyx_empty_tuple, /*PyObject *freevars,*/
24091  __pyx_empty_tuple, /*PyObject *cellvars,*/
24092  py_srcfile, /*PyObject *filename,*/
24093  py_funcname, /*PyObject *name,*/
24094  firstlineno,
24095  __pyx_empty_bytes /*PyObject *lnotab*/
24096  );
24097 bad:
24098  Py_XDECREF(py_srcfile);
24099  Py_XDECREF(py_funcname);
24100 #endif
24101  return py_code;
24102 }
24103 #endif
24104 
24105 /* PyObjectCall */
24106 #if CYTHON_COMPILING_IN_CPYTHON
24107 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24108  PyObject *result;
24109  ternaryfunc call = Py_TYPE(func)->tp_call;
24110  if (unlikely(!call))
24111  return PyObject_Call(func, arg, kw);
24112  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24113  return NULL;
24114  result = (*call)(func, arg, kw);
24115  Py_LeaveRecursiveCall();
24116  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24117  PyErr_SetString(
24118  PyExc_SystemError,
24119  "NULL result without error in PyObject_Call");
24120  }
24121  return result;
24122 }
24123 #endif
24124 
24125 /* RaiseException */
24126 #if PY_MAJOR_VERSION < 3
24127 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24128  CYTHON_UNUSED PyObject *cause) {
24129  __Pyx_PyThreadState_declare
24130  Py_XINCREF(type);
24131  if (!value || value == Py_None)
24132  value = NULL;
24133  else
24134  Py_INCREF(value);
24135  if (!tb || tb == Py_None)
24136  tb = NULL;
24137  else {
24138  Py_INCREF(tb);
24139  if (!PyTraceBack_Check(tb)) {
24140  PyErr_SetString(PyExc_TypeError,
24141  "raise: arg 3 must be a traceback or None");
24142  goto raise_error;
24143  }
24144  }
24145  if (PyType_Check(type)) {
24146 #if CYTHON_COMPILING_IN_PYPY
24147  if (!value) {
24148  Py_INCREF(Py_None);
24149  value = Py_None;
24150  }
24151 #endif
24152  PyErr_NormalizeException(&type, &value, &tb);
24153  } else {
24154  if (value) {
24155  PyErr_SetString(PyExc_TypeError,
24156  "instance exception may not have a separate value");
24157  goto raise_error;
24158  }
24159  value = type;
24160  type = (PyObject*) Py_TYPE(type);
24161  Py_INCREF(type);
24162  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24163  PyErr_SetString(PyExc_TypeError,
24164  "raise: exception class must be a subclass of BaseException");
24165  goto raise_error;
24166  }
24167  }
24168  __Pyx_PyThreadState_assign
24169  __Pyx_ErrRestore(type, value, tb);
24170  return;
24171 raise_error:
24172  Py_XDECREF(value);
24173  Py_XDECREF(type);
24174  Py_XDECREF(tb);
24175  return;
24176 }
24177 #else
24178 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24179  PyObject* owned_instance = NULL;
24180  if (tb == Py_None) {
24181  tb = 0;
24182  } else if (tb && !PyTraceBack_Check(tb)) {
24183  PyErr_SetString(PyExc_TypeError,
24184  "raise: arg 3 must be a traceback or None");
24185  goto bad;
24186  }
24187  if (value == Py_None)
24188  value = 0;
24189  if (PyExceptionInstance_Check(type)) {
24190  if (value) {
24191  PyErr_SetString(PyExc_TypeError,
24192  "instance exception may not have a separate value");
24193  goto bad;
24194  }
24195  value = type;
24196  type = (PyObject*) Py_TYPE(value);
24197  } else if (PyExceptionClass_Check(type)) {
24198  PyObject *instance_class = NULL;
24199  if (value && PyExceptionInstance_Check(value)) {
24200  instance_class = (PyObject*) Py_TYPE(value);
24201  if (instance_class != type) {
24202  int is_subclass = PyObject_IsSubclass(instance_class, type);
24203  if (!is_subclass) {
24204  instance_class = NULL;
24205  } else if (unlikely(is_subclass == -1)) {
24206  goto bad;
24207  } else {
24208  type = instance_class;
24209  }
24210  }
24211  }
24212  if (!instance_class) {
24213  PyObject *args;
24214  if (!value)
24215  args = PyTuple_New(0);
24216  else if (PyTuple_Check(value)) {
24217  Py_INCREF(value);
24218  args = value;
24219  } else
24220  args = PyTuple_Pack(1, value);
24221  if (!args)
24222  goto bad;
24223  owned_instance = PyObject_Call(type, args, NULL);
24224  Py_DECREF(args);
24225  if (!owned_instance)
24226  goto bad;
24227  value = owned_instance;
24228  if (!PyExceptionInstance_Check(value)) {
24229  PyErr_Format(PyExc_TypeError,
24230  "calling %R should have returned an instance of "
24231  "BaseException, not %R",
24232  type, Py_TYPE(value));
24233  goto bad;
24234  }
24235  }
24236  } else {
24237  PyErr_SetString(PyExc_TypeError,
24238  "raise: exception class must be a subclass of BaseException");
24239  goto bad;
24240  }
24241  if (cause) {
24242  PyObject *fixed_cause;
24243  if (cause == Py_None) {
24244  fixed_cause = NULL;
24245  } else if (PyExceptionClass_Check(cause)) {
24246  fixed_cause = PyObject_CallObject(cause, NULL);
24247  if (fixed_cause == NULL)
24248  goto bad;
24249  } else if (PyExceptionInstance_Check(cause)) {
24250  fixed_cause = cause;
24251  Py_INCREF(fixed_cause);
24252  } else {
24253  PyErr_SetString(PyExc_TypeError,
24254  "exception causes must derive from "
24255  "BaseException");
24256  goto bad;
24257  }
24258  PyException_SetCause(value, fixed_cause);
24259  }
24260  PyErr_SetObject(type, value);
24261  if (tb) {
24262 #if CYTHON_FAST_THREAD_STATE
24263  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24264  PyObject* tmp_tb = tstate->curexc_traceback;
24265  if (tb != tmp_tb) {
24266  Py_INCREF(tb);
24267  tstate->curexc_traceback = tb;
24268  Py_XDECREF(tmp_tb);
24269  }
24270 #else
24271  PyObject *tmp_type, *tmp_value, *tmp_tb;
24272  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24273  Py_INCREF(tb);
24274  PyErr_Restore(tmp_type, tmp_value, tb);
24275  Py_XDECREF(tmp_tb);
24276 #endif
24277  }
24278 bad:
24279  Py_XDECREF(owned_instance);
24280  return;
24281 }
24282 #endif
24283 
24284 /* PyIntCompare */
24285 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
24286  if (op1 == op2) {
24287  Py_RETURN_FALSE;
24288  }
24289  #if PY_MAJOR_VERSION < 3
24290  if (likely(PyInt_CheckExact(op1))) {
24291  const long b = intval;
24292  long a = PyInt_AS_LONG(op1);
24293  if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24294  }
24295  #endif
24296  #if CYTHON_USE_PYLONG_INTERNALS
24297  if (likely(PyLong_CheckExact(op1))) {
24298  int unequal;
24299  unsigned long uintval;
24300  Py_ssize_t size = Py_SIZE(op1);
24301  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24302  if (intval == 0) {
24303  if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24304  } else if (intval < 0) {
24305  if (size >= 0)
24306  Py_RETURN_TRUE;
24307  intval = -intval;
24308  size = -size;
24309  } else {
24310  if (size <= 0)
24311  Py_RETURN_TRUE;
24312  }
24313  uintval = (unsigned long) intval;
24314 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24315  if (uintval >> (PyLong_SHIFT * 4)) {
24316  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24317  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24318  } else
24319 #endif
24320 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24321  if (uintval >> (PyLong_SHIFT * 3)) {
24322  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24323  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24324  } else
24325 #endif
24326 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24327  if (uintval >> (PyLong_SHIFT * 2)) {
24328  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24329  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24330  } else
24331 #endif
24332 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24333  if (uintval >> (PyLong_SHIFT * 1)) {
24334  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24335  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24336  } else
24337 #endif
24338  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
24339  if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24340  }
24341  #endif
24342  if (PyFloat_CheckExact(op1)) {
24343  const long b = intval;
24344  double a = PyFloat_AS_DOUBLE(op1);
24345  if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24346  }
24347  return (
24348  PyObject_RichCompare(op1, op2, Py_NE));
24349 }
24350 
24351 /* BytesEquals */
24352 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24353 #if CYTHON_COMPILING_IN_PYPY
24354  return PyObject_RichCompareBool(s1, s2, equals);
24355 #else
24356  if (s1 == s2) {
24357  return (equals == Py_EQ);
24358  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24359  const char *ps1, *ps2;
24360  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24361  if (length != PyBytes_GET_SIZE(s2))
24362  return (equals == Py_NE);
24363  ps1 = PyBytes_AS_STRING(s1);
24364  ps2 = PyBytes_AS_STRING(s2);
24365  if (ps1[0] != ps2[0]) {
24366  return (equals == Py_NE);
24367  } else if (length == 1) {
24368  return (equals == Py_EQ);
24369  } else {
24370  int result;
24371 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24372  Py_hash_t hash1, hash2;
24373  hash1 = ((PyBytesObject*)s1)->ob_shash;
24374  hash2 = ((PyBytesObject*)s2)->ob_shash;
24375  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24376  return (equals == Py_NE);
24377  }
24378 #endif
24379  result = memcmp(ps1, ps2, (size_t)length);
24380  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24381  }
24382  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24383  return (equals == Py_NE);
24384  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24385  return (equals == Py_NE);
24386  } else {
24387  int result;
24388  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24389  if (!py_result)
24390  return -1;
24391  result = __Pyx_PyObject_IsTrue(py_result);
24392  Py_DECREF(py_result);
24393  return result;
24394  }
24395 #endif
24396 }
24397 
24398 /* PyDictVersioning */
24399 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24400 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24401  PyObject *dict = Py_TYPE(obj)->tp_dict;
24402  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24403 }
24404 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24405  PyObject **dictptr = NULL;
24406  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24407  if (offset) {
24408 #if CYTHON_COMPILING_IN_CPYTHON
24409  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24410 #else
24411  dictptr = _PyObject_GetDictPtr(obj);
24412 #endif
24413  }
24414  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24415 }
24416 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24417  PyObject *dict = Py_TYPE(obj)->tp_dict;
24418  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24419  return 0;
24420  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24421 }
24422 #endif
24423 
24424 /* GetModuleGlobalName */
24425 #if CYTHON_USE_DICT_VERSIONS
24426 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24427 #else
24428 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24429 #endif
24430 {
24431  PyObject *result;
24432 #if !CYTHON_AVOID_BORROWED_REFS
24433 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24434  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24435  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24436  if (likely(result)) {
24437  return __Pyx_NewRef(result);
24438  } else if (unlikely(PyErr_Occurred())) {
24439  return NULL;
24440  }
24441 #else
24442  result = PyDict_GetItem(__pyx_d, name);
24443  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24444  if (likely(result)) {
24445  return __Pyx_NewRef(result);
24446  }
24447 #endif
24448 #else
24449  result = PyObject_GetItem(__pyx_d, name);
24450  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24451  if (likely(result)) {
24452  return __Pyx_NewRef(result);
24453  }
24454  PyErr_Clear();
24455 #endif
24456  return __Pyx_GetBuiltinName(name);
24457 }
24458 
24459 /* PyCFunctionFastCall */
24460 #if CYTHON_FAST_PYCCALL
24461 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24462  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24463  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24464  PyObject *self = PyCFunction_GET_SELF(func);
24465  int flags = PyCFunction_GET_FLAGS(func);
24466  assert(PyCFunction_Check(func));
24467  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24468  assert(nargs >= 0);
24469  assert(nargs == 0 || args != NULL);
24470  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24471  because it may clear it (directly or indirectly) and so the
24472  caller loses its exception */
24473  assert(!PyErr_Occurred());
24474  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24475  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24476  } else {
24477  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24478  }
24479 }
24480 #endif
24481 
24482 /* PyFunctionFastCall */
24483 #if CYTHON_FAST_PYCALL
24484 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24485  PyObject *globals) {
24486  PyFrameObject *f;
24487  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24488  PyObject **fastlocals;
24489  Py_ssize_t i;
24490  PyObject *result;
24491  assert(globals != NULL);
24492  /* XXX Perhaps we should create a specialized
24493  PyFrame_New() that doesn't take locals, but does
24494  take builtins without sanity checking them.
24495  */
24496  assert(tstate != NULL);
24497  f = PyFrame_New(tstate, co, globals, NULL);
24498  if (f == NULL) {
24499  return NULL;
24500  }
24501  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24502  for (i = 0; i < na; i++) {
24503  Py_INCREF(*args);
24504  fastlocals[i] = *args++;
24505  }
24506  result = PyEval_EvalFrameEx(f,0);
24507  ++tstate->recursion_depth;
24508  Py_DECREF(f);
24509  --tstate->recursion_depth;
24510  return result;
24511 }
24512 #if 1 || PY_VERSION_HEX < 0x030600B1
24513 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24514  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24515  PyObject *globals = PyFunction_GET_GLOBALS(func);
24516  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24517  PyObject *closure;
24518 #if PY_MAJOR_VERSION >= 3
24519  PyObject *kwdefs;
24520 #endif
24521  PyObject *kwtuple, **k;
24522  PyObject **d;
24523  Py_ssize_t nd;
24524  Py_ssize_t nk;
24525  PyObject *result;
24526  assert(kwargs == NULL || PyDict_Check(kwargs));
24527  nk = kwargs ? PyDict_Size(kwargs) : 0;
24528  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24529  return NULL;
24530  }
24531  if (
24532 #if PY_MAJOR_VERSION >= 3
24533  co->co_kwonlyargcount == 0 &&
24534 #endif
24535  likely(kwargs == NULL || nk == 0) &&
24536  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24537  if (argdefs == NULL && co->co_argcount == nargs) {
24538  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24539  goto done;
24540  }
24541  else if (nargs == 0 && argdefs != NULL
24542  && co->co_argcount == Py_SIZE(argdefs)) {
24543  /* function called with no arguments, but all parameters have
24544  a default value: use default values as arguments .*/
24545  args = &PyTuple_GET_ITEM(argdefs, 0);
24546  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24547  goto done;
24548  }
24549  }
24550  if (kwargs != NULL) {
24551  Py_ssize_t pos, i;
24552  kwtuple = PyTuple_New(2 * nk);
24553  if (kwtuple == NULL) {
24554  result = NULL;
24555  goto done;
24556  }
24557  k = &PyTuple_GET_ITEM(kwtuple, 0);
24558  pos = i = 0;
24559  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24560  Py_INCREF(k[i]);
24561  Py_INCREF(k[i+1]);
24562  i += 2;
24563  }
24564  nk = i / 2;
24565  }
24566  else {
24567  kwtuple = NULL;
24568  k = NULL;
24569  }
24570  closure = PyFunction_GET_CLOSURE(func);
24571 #if PY_MAJOR_VERSION >= 3
24572  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24573 #endif
24574  if (argdefs != NULL) {
24575  d = &PyTuple_GET_ITEM(argdefs, 0);
24576  nd = Py_SIZE(argdefs);
24577  }
24578  else {
24579  d = NULL;
24580  nd = 0;
24581  }
24582 #if PY_MAJOR_VERSION >= 3
24583  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24584  args, (int)nargs,
24585  k, (int)nk,
24586  d, (int)nd, kwdefs, closure);
24587 #else
24588  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24589  args, (int)nargs,
24590  k, (int)nk,
24591  d, (int)nd, closure);
24592 #endif
24593  Py_XDECREF(kwtuple);
24594 done:
24595  Py_LeaveRecursiveCall();
24596  return result;
24597 }
24598 #endif
24599 #endif
24600 
24601 /* PyObjectCall2Args */
24602 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24603  PyObject *args, *result = NULL;
24604  #if CYTHON_FAST_PYCALL
24605  if (PyFunction_Check(function)) {
24606  PyObject *args[2] = {arg1, arg2};
24607  return __Pyx_PyFunction_FastCall(function, args, 2);
24608  }
24609  #endif
24610  #if CYTHON_FAST_PYCCALL
24611  if (__Pyx_PyFastCFunction_Check(function)) {
24612  PyObject *args[2] = {arg1, arg2};
24613  return __Pyx_PyCFunction_FastCall(function, args, 2);
24614  }
24615  #endif
24616  args = PyTuple_New(2);
24617  if (unlikely(!args)) goto done;
24618  Py_INCREF(arg1);
24619  PyTuple_SET_ITEM(args, 0, arg1);
24620  Py_INCREF(arg2);
24621  PyTuple_SET_ITEM(args, 1, arg2);
24622  Py_INCREF(function);
24623  result = __Pyx_PyObject_Call(function, args, NULL);
24624  Py_DECREF(args);
24625  Py_DECREF(function);
24626 done:
24627  return result;
24628 }
24629 
24630 /* PyObjectCallMethO */
24631 #if CYTHON_COMPILING_IN_CPYTHON
24632 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24633  PyObject *self, *result;
24634  PyCFunction cfunc;
24635  cfunc = PyCFunction_GET_FUNCTION(func);
24636  self = PyCFunction_GET_SELF(func);
24637  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24638  return NULL;
24639  result = cfunc(self, arg);
24640  Py_LeaveRecursiveCall();
24641  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24642  PyErr_SetString(
24643  PyExc_SystemError,
24644  "NULL result without error in PyObject_Call");
24645  }
24646  return result;
24647 }
24648 #endif
24649 
24650 /* PyObjectCallOneArg */
24651 #if CYTHON_COMPILING_IN_CPYTHON
24652 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24653  PyObject *result;
24654  PyObject *args = PyTuple_New(1);
24655  if (unlikely(!args)) return NULL;
24656  Py_INCREF(arg);
24657  PyTuple_SET_ITEM(args, 0, arg);
24658  result = __Pyx_PyObject_Call(func, args, NULL);
24659  Py_DECREF(args);
24660  return result;
24661 }
24662 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24663 #if CYTHON_FAST_PYCALL
24664  if (PyFunction_Check(func)) {
24665  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24666  }
24667 #endif
24668  if (likely(PyCFunction_Check(func))) {
24669  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24670  return __Pyx_PyObject_CallMethO(func, arg);
24671 #if CYTHON_FAST_PYCCALL
24672  } else if (__Pyx_PyFastCFunction_Check(func)) {
24673  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24674 #endif
24675  }
24676  }
24677  return __Pyx__PyObject_CallOneArg(func, arg);
24678 }
24679 #else
24680 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24681  PyObject *result;
24682  PyObject *args = PyTuple_Pack(1, arg);
24683  if (unlikely(!args)) return NULL;
24684  result = __Pyx_PyObject_Call(func, args, NULL);
24685  Py_DECREF(args);
24686  return result;
24687 }
24688 #endif
24689 
24690 /* PyObjectCallNoArg */
24691 #if CYTHON_COMPILING_IN_CPYTHON
24692 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24693 #if CYTHON_FAST_PYCALL
24694  if (PyFunction_Check(func)) {
24695  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24696  }
24697 #endif
24698 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
24699  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24700 #else
24701  if (likely(PyCFunction_Check(func)))
24702 #endif
24703  {
24704  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24705  return __Pyx_PyObject_CallMethO(func, NULL);
24706  }
24707  }
24708  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24709 }
24710 #endif
24711 
24712 /* GetItemInt */
24713 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24714  PyObject *r;
24715  if (!j) return NULL;
24716  r = PyObject_GetItem(o, j);
24717  Py_DECREF(j);
24718  return r;
24719 }
24720 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24721  CYTHON_NCP_UNUSED int wraparound,
24722  CYTHON_NCP_UNUSED int boundscheck) {
24723 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24724  Py_ssize_t wrapped_i = i;
24725  if (wraparound & unlikely(i < 0)) {
24726  wrapped_i += PyList_GET_SIZE(o);
24727  }
24728  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24729  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24730  Py_INCREF(r);
24731  return r;
24732  }
24733  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24734 #else
24735  return PySequence_GetItem(o, i);
24736 #endif
24737 }
24738 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24739  CYTHON_NCP_UNUSED int wraparound,
24740  CYTHON_NCP_UNUSED int boundscheck) {
24741 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24742  Py_ssize_t wrapped_i = i;
24743  if (wraparound & unlikely(i < 0)) {
24744  wrapped_i += PyTuple_GET_SIZE(o);
24745  }
24746  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24747  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24748  Py_INCREF(r);
24749  return r;
24750  }
24751  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24752 #else
24753  return PySequence_GetItem(o, i);
24754 #endif
24755 }
24756 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24757  CYTHON_NCP_UNUSED int wraparound,
24758  CYTHON_NCP_UNUSED int boundscheck) {
24759 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24760  if (is_list || PyList_CheckExact(o)) {
24761  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24762  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24763  PyObject *r = PyList_GET_ITEM(o, n);
24764  Py_INCREF(r);
24765  return r;
24766  }
24767  }
24768  else if (PyTuple_CheckExact(o)) {
24769  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24770  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24771  PyObject *r = PyTuple_GET_ITEM(o, n);
24772  Py_INCREF(r);
24773  return r;
24774  }
24775  } else {
24776  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24777  if (likely(m && m->sq_item)) {
24778  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24779  Py_ssize_t l = m->sq_length(o);
24780  if (likely(l >= 0)) {
24781  i += l;
24782  } else {
24783  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24784  return NULL;
24785  PyErr_Clear();
24786  }
24787  }
24788  return m->sq_item(o, i);
24789  }
24790  }
24791 #else
24792  if (is_list || PySequence_Check(o)) {
24793  return PySequence_GetItem(o, i);
24794  }
24795 #endif
24796  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24797 }
24798 
24799 /* DictGetItem */
24800 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24801 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24802  PyObject *value;
24803  value = PyDict_GetItemWithError(d, key);
24804  if (unlikely(!value)) {
24805  if (!PyErr_Occurred()) {
24806  if (unlikely(PyTuple_Check(key))) {
24807  PyObject* args = PyTuple_Pack(1, key);
24808  if (likely(args)) {
24809  PyErr_SetObject(PyExc_KeyError, args);
24810  Py_DECREF(args);
24811  }
24812  } else {
24813  PyErr_SetObject(PyExc_KeyError, key);
24814  }
24815  }
24816  return NULL;
24817  }
24818  Py_INCREF(value);
24819  return value;
24820 }
24821 #endif
24822 
24823 /* MemviewSliceInit */
24824 static int
24825 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24826  int ndim,
24827  __Pyx_memviewslice *memviewslice,
24828  int memview_is_new_reference)
24829 {
24830  __Pyx_RefNannyDeclarations
24831  int i, retval=-1;
24832  Py_buffer *buf = &memview->view;
24833  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24834  if (unlikely(memviewslice->memview || memviewslice->data)) {
24835  PyErr_SetString(PyExc_ValueError,
24836  "memviewslice is already initialized!");
24837  goto fail;
24838  }
24839  if (buf->strides) {
24840  for (i = 0; i < ndim; i++) {
24841  memviewslice->strides[i] = buf->strides[i];
24842  }
24843  } else {
24844  Py_ssize_t stride = buf->itemsize;
24845  for (i = ndim - 1; i >= 0; i--) {
24846  memviewslice->strides[i] = stride;
24847  stride *= buf->shape[i];
24848  }
24849  }
24850  for (i = 0; i < ndim; i++) {
24851  memviewslice->shape[i] = buf->shape[i];
24852  if (buf->suboffsets) {
24853  memviewslice->suboffsets[i] = buf->suboffsets[i];
24854  } else {
24855  memviewslice->suboffsets[i] = -1;
24856  }
24857  }
24858  memviewslice->memview = memview;
24859  memviewslice->data = (char *)buf->buf;
24860  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24861  Py_INCREF(memview);
24862  }
24863  retval = 0;
24864  goto no_fail;
24865 fail:
24866  memviewslice->memview = 0;
24867  memviewslice->data = 0;
24868  retval = -1;
24869 no_fail:
24870  __Pyx_RefNannyFinishContext();
24871  return retval;
24872 }
24873 #ifndef Py_NO_RETURN
24874 #define Py_NO_RETURN
24875 #endif
24876 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24877  va_list vargs;
24878  char msg[200];
24879 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
24880  va_start(vargs, fmt);
24881 #else
24882  va_start(vargs);
24883 #endif
24884  vsnprintf(msg, 200, fmt, vargs);
24885  va_end(vargs);
24886  Py_FatalError(msg);
24887 }
24888 static CYTHON_INLINE int
24889 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24890  PyThread_type_lock lock)
24891 {
24892  int result;
24893  PyThread_acquire_lock(lock, 1);
24894  result = (*acquisition_count)++;
24895  PyThread_release_lock(lock);
24896  return result;
24897 }
24898 static CYTHON_INLINE int
24899 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24900  PyThread_type_lock lock)
24901 {
24902  int result;
24903  PyThread_acquire_lock(lock, 1);
24904  result = (*acquisition_count)--;
24905  PyThread_release_lock(lock);
24906  return result;
24907 }
24908 static CYTHON_INLINE void
24909 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24910 {
24911  int first_time;
24912  struct __pyx_memoryview_obj *memview = memslice->memview;
24913  if (unlikely(!memview || (PyObject *) memview == Py_None))
24914  return;
24915  if (unlikely(__pyx_get_slice_count(memview) < 0))
24916  __pyx_fatalerror("Acquisition count is %d (line %d)",
24917  __pyx_get_slice_count(memview), lineno);
24918  first_time = __pyx_add_acquisition_count(memview) == 0;
24919  if (unlikely(first_time)) {
24920  if (have_gil) {
24921  Py_INCREF((PyObject *) memview);
24922  } else {
24923  PyGILState_STATE _gilstate = PyGILState_Ensure();
24924  Py_INCREF((PyObject *) memview);
24925  PyGILState_Release(_gilstate);
24926  }
24927  }
24928 }
24929 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24930  int have_gil, int lineno) {
24931  int last_time;
24932  struct __pyx_memoryview_obj *memview = memslice->memview;
24933  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24934  memslice->memview = NULL;
24935  return;
24936  }
24937  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24938  __pyx_fatalerror("Acquisition count is %d (line %d)",
24939  __pyx_get_slice_count(memview), lineno);
24940  last_time = __pyx_sub_acquisition_count(memview) == 1;
24941  memslice->data = NULL;
24942  if (unlikely(last_time)) {
24943  if (have_gil) {
24944  Py_CLEAR(memslice->memview);
24945  } else {
24946  PyGILState_STATE _gilstate = PyGILState_Ensure();
24947  Py_CLEAR(memslice->memview);
24948  PyGILState_Release(_gilstate);
24949  }
24950  } else {
24951  memslice->memview = NULL;
24952  }
24953 }
24954 
24955 /* ArgTypeTest */
24956 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24957 {
24958  if (unlikely(!type)) {
24959  PyErr_SetString(PyExc_SystemError, "Missing type object");
24960  return 0;
24961  }
24962  else if (exact) {
24963  #if PY_MAJOR_VERSION == 2
24964  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24965  #endif
24966  }
24967  else {
24968  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24969  }
24970  PyErr_Format(PyExc_TypeError,
24971  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24972  name, type->tp_name, Py_TYPE(obj)->tp_name);
24973  return 0;
24974 }
24975 
24976 /* UnicodeEquals */
24977 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24978 #if CYTHON_COMPILING_IN_PYPY
24979  return PyObject_RichCompareBool(s1, s2, equals);
24980 #else
24981 #if PY_MAJOR_VERSION < 3
24982  PyObject* owned_ref = NULL;
24983 #endif
24984  int s1_is_unicode, s2_is_unicode;
24985  if (s1 == s2) {
24986  goto return_eq;
24987  }
24988  s1_is_unicode = PyUnicode_CheckExact(s1);
24989  s2_is_unicode = PyUnicode_CheckExact(s2);
24990 #if PY_MAJOR_VERSION < 3
24991  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24992  owned_ref = PyUnicode_FromObject(s2);
24993  if (unlikely(!owned_ref))
24994  return -1;
24995  s2 = owned_ref;
24996  s2_is_unicode = 1;
24997  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24998  owned_ref = PyUnicode_FromObject(s1);
24999  if (unlikely(!owned_ref))
25000  return -1;
25001  s1 = owned_ref;
25002  s1_is_unicode = 1;
25003  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25004  return __Pyx_PyBytes_Equals(s1, s2, equals);
25005  }
25006 #endif
25007  if (s1_is_unicode & s2_is_unicode) {
25008  Py_ssize_t length;
25009  int kind;
25010  void *data1, *data2;
25011  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25012  return -1;
25013  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25014  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25015  goto return_ne;
25016  }
25017 #if CYTHON_USE_UNICODE_INTERNALS
25018  {
25019  Py_hash_t hash1, hash2;
25020  #if CYTHON_PEP393_ENABLED
25021  hash1 = ((PyASCIIObject*)s1)->hash;
25022  hash2 = ((PyASCIIObject*)s2)->hash;
25023  #else
25024  hash1 = ((PyUnicodeObject*)s1)->hash;
25025  hash2 = ((PyUnicodeObject*)s2)->hash;
25026  #endif
25027  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25028  goto return_ne;
25029  }
25030  }
25031 #endif
25032  kind = __Pyx_PyUnicode_KIND(s1);
25033  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25034  goto return_ne;
25035  }
25036  data1 = __Pyx_PyUnicode_DATA(s1);
25037  data2 = __Pyx_PyUnicode_DATA(s2);
25038  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25039  goto return_ne;
25040  } else if (length == 1) {
25041  goto return_eq;
25042  } else {
25043  int result = memcmp(data1, data2, (size_t)(length * kind));
25044  #if PY_MAJOR_VERSION < 3
25045  Py_XDECREF(owned_ref);
25046  #endif
25047  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25048  }
25049  } else if ((s1 == Py_None) & s2_is_unicode) {
25050  goto return_ne;
25051  } else if ((s2 == Py_None) & s1_is_unicode) {
25052  goto return_ne;
25053  } else {
25054  int result;
25055  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25056  #if PY_MAJOR_VERSION < 3
25057  Py_XDECREF(owned_ref);
25058  #endif
25059  if (!py_result)
25060  return -1;
25061  result = __Pyx_PyObject_IsTrue(py_result);
25062  Py_DECREF(py_result);
25063  return result;
25064  }
25065 return_eq:
25066  #if PY_MAJOR_VERSION < 3
25067  Py_XDECREF(owned_ref);
25068  #endif
25069  return (equals == Py_EQ);
25070 return_ne:
25071  #if PY_MAJOR_VERSION < 3
25072  Py_XDECREF(owned_ref);
25073  #endif
25074  return (equals == Py_NE);
25075 #endif
25076 }
25077 
25078 /* WriteUnraisableException */
25079 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25080  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25081  int full_traceback, CYTHON_UNUSED int nogil) {
25082  PyObject *old_exc, *old_val, *old_tb;
25083  PyObject *ctx;
25084  __Pyx_PyThreadState_declare
25085 #ifdef WITH_THREAD
25086  PyGILState_STATE state;
25087  if (nogil)
25088  state = PyGILState_Ensure();
25089  else state = (PyGILState_STATE)0;
25090 #endif
25091  __Pyx_PyThreadState_assign
25092  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25093  if (full_traceback) {
25094  Py_XINCREF(old_exc);
25095  Py_XINCREF(old_val);
25096  Py_XINCREF(old_tb);
25097  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25098  PyErr_PrintEx(1);
25099  }
25100  #if PY_MAJOR_VERSION < 3
25101  ctx = PyString_FromString(name);
25102  #else
25103  ctx = PyUnicode_FromString(name);
25104  #endif
25105  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25106  if (!ctx) {
25107  PyErr_WriteUnraisable(Py_None);
25108  } else {
25109  PyErr_WriteUnraisable(ctx);
25110  Py_DECREF(ctx);
25111  }
25112 #ifdef WITH_THREAD
25113  if (nogil)
25114  PyGILState_Release(state);
25115 #endif
25116 }
25117 
25118 /* GetAttr */
25119 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25120 #if CYTHON_USE_TYPE_SLOTS
25121 #if PY_MAJOR_VERSION >= 3
25122  if (likely(PyUnicode_Check(n)))
25123 #else
25124  if (likely(PyString_Check(n)))
25125 #endif
25126  return __Pyx_PyObject_GetAttrStr(o, n);
25127 #endif
25128  return PyObject_GetAttr(o, n);
25129 }
25130 
25131 /* ObjectGetItem */
25132 #if CYTHON_USE_TYPE_SLOTS
25133 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25134  PyObject *runerr = NULL;
25135  Py_ssize_t key_value;
25136  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25137  if (unlikely(!(m && m->sq_item))) {
25138  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25139  return NULL;
25140  }
25141  key_value = __Pyx_PyIndex_AsSsize_t(index);
25142  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25143  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25144  }
25145  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25146  PyErr_Clear();
25147  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25148  }
25149  return NULL;
25150 }
25151 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25152  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25153  if (likely(m && m->mp_subscript)) {
25154  return m->mp_subscript(obj, key);
25155  }
25156  return __Pyx_PyObject_GetIndex(obj, key);
25157 }
25158 #endif
25159 
25160 /* decode_c_string */
25161 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25162  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25163  const char* encoding, const char* errors,
25164  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25165  Py_ssize_t length;
25166  if (unlikely((start < 0) | (stop < 0))) {
25167  size_t slen = strlen(cstring);
25168  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25169  PyErr_SetString(PyExc_OverflowError,
25170  "c-string too long to convert to Python");
25171  return NULL;
25172  }
25173  length = (Py_ssize_t) slen;
25174  if (start < 0) {
25175  start += length;
25176  if (start < 0)
25177  start = 0;
25178  }
25179  if (stop < 0)
25180  stop += length;
25181  }
25182  if (unlikely(stop <= start))
25183  return __Pyx_NewRef(__pyx_empty_unicode);
25184  length = stop - start;
25185  cstring += start;
25186  if (decode_func) {
25187  return decode_func(cstring, length, errors);
25188  } else {
25189  return PyUnicode_Decode(cstring, length, encoding, errors);
25190  }
25191 }
25192 
25193 /* PyErrExceptionMatches */
25194 #if CYTHON_FAST_THREAD_STATE
25195 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25196  Py_ssize_t i, n;
25197  n = PyTuple_GET_SIZE(tuple);
25198 #if PY_MAJOR_VERSION >= 3
25199  for (i=0; i<n; i++) {
25200  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25201  }
25202 #endif
25203  for (i=0; i<n; i++) {
25204  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25205  }
25206  return 0;
25207 }
25208 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25209  PyObject *exc_type = tstate->curexc_type;
25210  if (exc_type == err) return 1;
25211  if (unlikely(!exc_type)) return 0;
25212  if (unlikely(PyTuple_Check(err)))
25213  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25214  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25215 }
25216 #endif
25217 
25218 /* GetAttr3 */
25219 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25220  __Pyx_PyThreadState_declare
25221  __Pyx_PyThreadState_assign
25222  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25223  return NULL;
25224  __Pyx_PyErr_Clear();
25225  Py_INCREF(d);
25226  return d;
25227 }
25228 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25229  PyObject *r = __Pyx_GetAttr(o, n);
25230  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25231 }
25232 
25233 /* RaiseTooManyValuesToUnpack */
25234 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25235  PyErr_Format(PyExc_ValueError,
25236  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25237 }
25238 
25239 /* RaiseNeedMoreValuesToUnpack */
25240 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25241  PyErr_Format(PyExc_ValueError,
25242  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25243  index, (index == 1) ? "" : "s");
25244 }
25245 
25246 /* RaiseNoneIterError */
25247 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25248  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25249 }
25250 
25251 /* ExtTypeTest */
25252 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25253  if (unlikely(!type)) {
25254  PyErr_SetString(PyExc_SystemError, "Missing type object");
25255  return 0;
25256  }
25257  if (likely(__Pyx_TypeCheck(obj, type)))
25258  return 1;
25259  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25260  Py_TYPE(obj)->tp_name, type->tp_name);
25261  return 0;
25262 }
25263 
25264 /* GetTopmostException */
25265 #if CYTHON_USE_EXC_INFO_STACK
25266 static _PyErr_StackItem *
25267 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25268 {
25269  _PyErr_StackItem *exc_info = tstate->exc_info;
25270  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25271  exc_info->previous_item != NULL)
25272  {
25273  exc_info = exc_info->previous_item;
25274  }
25275  return exc_info;
25276 }
25277 #endif
25278 
25279 /* SaveResetException */
25280 #if CYTHON_FAST_THREAD_STATE
25281 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25282  #if CYTHON_USE_EXC_INFO_STACK
25283  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25284  *type = exc_info->exc_type;
25285  *value = exc_info->exc_value;
25286  *tb = exc_info->exc_traceback;
25287  #else
25288  *type = tstate->exc_type;
25289  *value = tstate->exc_value;
25290  *tb = tstate->exc_traceback;
25291  #endif
25292  Py_XINCREF(*type);
25293  Py_XINCREF(*value);
25294  Py_XINCREF(*tb);
25295 }
25296 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25297  PyObject *tmp_type, *tmp_value, *tmp_tb;
25298  #if CYTHON_USE_EXC_INFO_STACK
25299  _PyErr_StackItem *exc_info = tstate->exc_info;
25300  tmp_type = exc_info->exc_type;
25301  tmp_value = exc_info->exc_value;
25302  tmp_tb = exc_info->exc_traceback;
25303  exc_info->exc_type = type;
25304  exc_info->exc_value = value;
25305  exc_info->exc_traceback = tb;
25306  #else
25307  tmp_type = tstate->exc_type;
25308  tmp_value = tstate->exc_value;
25309  tmp_tb = tstate->exc_traceback;
25310  tstate->exc_type = type;
25311  tstate->exc_value = value;
25312  tstate->exc_traceback = tb;
25313  #endif
25314  Py_XDECREF(tmp_type);
25315  Py_XDECREF(tmp_value);
25316  Py_XDECREF(tmp_tb);
25317 }
25318 #endif
25319 
25320 /* GetException */
25321 #if CYTHON_FAST_THREAD_STATE
25322 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25323 #else
25324 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25325 #endif
25326 {
25327  PyObject *local_type, *local_value, *local_tb;
25328 #if CYTHON_FAST_THREAD_STATE
25329  PyObject *tmp_type, *tmp_value, *tmp_tb;
25330  local_type = tstate->curexc_type;
25331  local_value = tstate->curexc_value;
25332  local_tb = tstate->curexc_traceback;
25333  tstate->curexc_type = 0;
25334  tstate->curexc_value = 0;
25335  tstate->curexc_traceback = 0;
25336 #else
25337  PyErr_Fetch(&local_type, &local_value, &local_tb);
25338 #endif
25339  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25340 #if CYTHON_FAST_THREAD_STATE
25341  if (unlikely(tstate->curexc_type))
25342 #else
25343  if (unlikely(PyErr_Occurred()))
25344 #endif
25345  goto bad;
25346  #if PY_MAJOR_VERSION >= 3
25347  if (local_tb) {
25348  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25349  goto bad;
25350  }
25351  #endif
25352  Py_XINCREF(local_tb);
25353  Py_XINCREF(local_type);
25354  Py_XINCREF(local_value);
25355  *type = local_type;
25356  *value = local_value;
25357  *tb = local_tb;
25358 #if CYTHON_FAST_THREAD_STATE
25359  #if CYTHON_USE_EXC_INFO_STACK
25360  {
25361  _PyErr_StackItem *exc_info = tstate->exc_info;
25362  tmp_type = exc_info->exc_type;
25363  tmp_value = exc_info->exc_value;
25364  tmp_tb = exc_info->exc_traceback;
25365  exc_info->exc_type = local_type;
25366  exc_info->exc_value = local_value;
25367  exc_info->exc_traceback = local_tb;
25368  }
25369  #else
25370  tmp_type = tstate->exc_type;
25371  tmp_value = tstate->exc_value;
25372  tmp_tb = tstate->exc_traceback;
25373  tstate->exc_type = local_type;
25374  tstate->exc_value = local_value;
25375  tstate->exc_traceback = local_tb;
25376  #endif
25377  Py_XDECREF(tmp_type);
25378  Py_XDECREF(tmp_value);
25379  Py_XDECREF(tmp_tb);
25380 #else
25381  PyErr_SetExcInfo(local_type, local_value, local_tb);
25382 #endif
25383  return 0;
25384 bad:
25385  *type = 0;
25386  *value = 0;
25387  *tb = 0;
25388  Py_XDECREF(local_type);
25389  Py_XDECREF(local_value);
25390  Py_XDECREF(local_tb);
25391  return -1;
25392 }
25393 
25394 /* SwapException */
25395 #if CYTHON_FAST_THREAD_STATE
25396 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25397  PyObject *tmp_type, *tmp_value, *tmp_tb;
25398  #if CYTHON_USE_EXC_INFO_STACK
25399  _PyErr_StackItem *exc_info = tstate->exc_info;
25400  tmp_type = exc_info->exc_type;
25401  tmp_value = exc_info->exc_value;
25402  tmp_tb = exc_info->exc_traceback;
25403  exc_info->exc_type = *type;
25404  exc_info->exc_value = *value;
25405  exc_info->exc_traceback = *tb;
25406  #else
25407  tmp_type = tstate->exc_type;
25408  tmp_value = tstate->exc_value;
25409  tmp_tb = tstate->exc_traceback;
25410  tstate->exc_type = *type;
25411  tstate->exc_value = *value;
25412  tstate->exc_traceback = *tb;
25413  #endif
25414  *type = tmp_type;
25415  *value = tmp_value;
25416  *tb = tmp_tb;
25417 }
25418 #else
25419 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25420  PyObject *tmp_type, *tmp_value, *tmp_tb;
25421  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25422  PyErr_SetExcInfo(*type, *value, *tb);
25423  *type = tmp_type;
25424  *value = tmp_value;
25425  *tb = tmp_tb;
25426 }
25427 #endif
25428 
25429 /* Import */
25430 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25431  PyObject *empty_list = 0;
25432  PyObject *module = 0;
25433  PyObject *global_dict = 0;
25434  PyObject *empty_dict = 0;
25435  PyObject *list;
25436  #if PY_MAJOR_VERSION < 3
25437  PyObject *py_import;
25438  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25439  if (!py_import)
25440  goto bad;
25441  #endif
25442  if (from_list)
25443  list = from_list;
25444  else {
25445  empty_list = PyList_New(0);
25446  if (!empty_list)
25447  goto bad;
25448  list = empty_list;
25449  }
25450  global_dict = PyModule_GetDict(__pyx_m);
25451  if (!global_dict)
25452  goto bad;
25453  empty_dict = PyDict_New();
25454  if (!empty_dict)
25455  goto bad;
25456  {
25457  #if PY_MAJOR_VERSION >= 3
25458  if (level == -1) {
25459  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25460  module = PyImport_ImportModuleLevelObject(
25461  name, global_dict, empty_dict, list, 1);
25462  if (!module) {
25463  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25464  goto bad;
25465  PyErr_Clear();
25466  }
25467  }
25468  level = 0;
25469  }
25470  #endif
25471  if (!module) {
25472  #if PY_MAJOR_VERSION < 3
25473  PyObject *py_level = PyInt_FromLong(level);
25474  if (!py_level)
25475  goto bad;
25476  module = PyObject_CallFunctionObjArgs(py_import,
25477  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25478  Py_DECREF(py_level);
25479  #else
25480  module = PyImport_ImportModuleLevelObject(
25481  name, global_dict, empty_dict, list, level);
25482  #endif
25483  }
25484  }
25485 bad:
25486  #if PY_MAJOR_VERSION < 3
25487  Py_XDECREF(py_import);
25488  #endif
25489  Py_XDECREF(empty_list);
25490  Py_XDECREF(empty_dict);
25491  return module;
25492 }
25493 
25494 /* FastTypeChecks */
25495 #if CYTHON_COMPILING_IN_CPYTHON
25496 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25497  while (a) {
25498  a = a->tp_base;
25499  if (a == b)
25500  return 1;
25501  }
25502  return b == &PyBaseObject_Type;
25503 }
25504 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25505  PyObject *mro;
25506  if (a == b) return 1;
25507  mro = a->tp_mro;
25508  if (likely(mro)) {
25509  Py_ssize_t i, n;
25510  n = PyTuple_GET_SIZE(mro);
25511  for (i = 0; i < n; i++) {
25512  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25513  return 1;
25514  }
25515  return 0;
25516  }
25517  return __Pyx_InBases(a, b);
25518 }
25519 #if PY_MAJOR_VERSION == 2
25520 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25521  PyObject *exception, *value, *tb;
25522  int res;
25523  __Pyx_PyThreadState_declare
25524  __Pyx_PyThreadState_assign
25525  __Pyx_ErrFetch(&exception, &value, &tb);
25526  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25527  if (unlikely(res == -1)) {
25528  PyErr_WriteUnraisable(err);
25529  res = 0;
25530  }
25531  if (!res) {
25532  res = PyObject_IsSubclass(err, exc_type2);
25533  if (unlikely(res == -1)) {
25534  PyErr_WriteUnraisable(err);
25535  res = 0;
25536  }
25537  }
25538  __Pyx_ErrRestore(exception, value, tb);
25539  return res;
25540 }
25541 #else
25542 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25543  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25544  if (!res) {
25545  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25546  }
25547  return res;
25548 }
25549 #endif
25550 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25551  Py_ssize_t i, n;
25552  assert(PyExceptionClass_Check(exc_type));
25553  n = PyTuple_GET_SIZE(tuple);
25554 #if PY_MAJOR_VERSION >= 3
25555  for (i=0; i<n; i++) {
25556  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25557  }
25558 #endif
25559  for (i=0; i<n; i++) {
25560  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25561  #if PY_MAJOR_VERSION < 3
25562  if (likely(exc_type == t)) return 1;
25563  #endif
25564  if (likely(PyExceptionClass_Check(t))) {
25565  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25566  } else {
25567  }
25568  }
25569  return 0;
25570 }
25571 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25572  if (likely(err == exc_type)) return 1;
25573  if (likely(PyExceptionClass_Check(err))) {
25574  if (likely(PyExceptionClass_Check(exc_type))) {
25575  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25576  } else if (likely(PyTuple_Check(exc_type))) {
25577  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25578  } else {
25579  }
25580  }
25581  return PyErr_GivenExceptionMatches(err, exc_type);
25582 }
25583 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25584  assert(PyExceptionClass_Check(exc_type1));
25585  assert(PyExceptionClass_Check(exc_type2));
25586  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25587  if (likely(PyExceptionClass_Check(err))) {
25588  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25589  }
25590  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25591 }
25592 #endif
25593 
25594 /* PyIntBinop */
25595 #if !CYTHON_COMPILING_IN_PYPY
25596 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
25597  (void)inplace;
25598  (void)zerodivision_check;
25599  #if PY_MAJOR_VERSION < 3
25600  if (likely(PyInt_CheckExact(op1))) {
25601  const long b = intval;
25602  long x;
25603  long a = PyInt_AS_LONG(op1);
25604  x = (long)((unsigned long)a + b);
25605  if (likely((x^a) >= 0 || (x^b) >= 0))
25606  return PyInt_FromLong(x);
25607  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25608  }
25609  #endif
25610  #if CYTHON_USE_PYLONG_INTERNALS
25611  if (likely(PyLong_CheckExact(op1))) {
25612  const long b = intval;
25613  long a, x;
25614 #ifdef HAVE_LONG_LONG
25615  const PY_LONG_LONG llb = intval;
25616  PY_LONG_LONG lla, llx;
25617 #endif
25618  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25619  const Py_ssize_t size = Py_SIZE(op1);
25620  if (likely(__Pyx_sst_abs(size) <= 1)) {
25621  a = likely(size) ? digits[0] : 0;
25622  if (size == -1) a = -a;
25623  } else {
25624  switch (size) {
25625  case -2:
25626  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25627  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25628  break;
25629 #ifdef HAVE_LONG_LONG
25630  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25631  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25632  goto long_long;
25633 #endif
25634  }
25635  CYTHON_FALLTHROUGH;
25636  case 2:
25637  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25638  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25639  break;
25640 #ifdef HAVE_LONG_LONG
25641  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25642  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25643  goto long_long;
25644 #endif
25645  }
25646  CYTHON_FALLTHROUGH;
25647  case -3:
25648  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25649  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25650  break;
25651 #ifdef HAVE_LONG_LONG
25652  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25653  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25654  goto long_long;
25655 #endif
25656  }
25657  CYTHON_FALLTHROUGH;
25658  case 3:
25659  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25660  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25661  break;
25662 #ifdef HAVE_LONG_LONG
25663  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25664  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25665  goto long_long;
25666 #endif
25667  }
25668  CYTHON_FALLTHROUGH;
25669  case -4:
25670  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25671  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25672  break;
25673 #ifdef HAVE_LONG_LONG
25674  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25675  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25676  goto long_long;
25677 #endif
25678  }
25679  CYTHON_FALLTHROUGH;
25680  case 4:
25681  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25682  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25683  break;
25684 #ifdef HAVE_LONG_LONG
25685  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25686  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25687  goto long_long;
25688 #endif
25689  }
25690  CYTHON_FALLTHROUGH;
25691  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25692  }
25693  }
25694  x = a + b;
25695  return PyLong_FromLong(x);
25696 #ifdef HAVE_LONG_LONG
25697  long_long:
25698  llx = lla + llb;
25699  return PyLong_FromLongLong(llx);
25700 #endif
25701 
25702 
25703  }
25704  #endif
25705  if (PyFloat_CheckExact(op1)) {
25706  const long b = intval;
25707  double a = PyFloat_AS_DOUBLE(op1);
25708  double result;
25709  PyFPE_START_PROTECT("add", return NULL)
25710  result = ((double)a) + (double)b;
25711  PyFPE_END_PROTECT(result)
25712  return PyFloat_FromDouble(result);
25713  }
25714  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25715 }
25716 #endif
25717 
25718 /* None */
25719 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25720  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25721 }
25722 
25723 /* ImportFrom */
25724 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25725  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25726  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25727  PyErr_Format(PyExc_ImportError,
25728  #if PY_MAJOR_VERSION < 3
25729  "cannot import name %.230s", PyString_AS_STRING(name));
25730  #else
25731  "cannot import name %S", name);
25732  #endif
25733  }
25734  return value;
25735 }
25736 
25737 /* HasAttr */
25738 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25739  PyObject *r;
25740  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25741  PyErr_SetString(PyExc_TypeError,
25742  "hasattr(): attribute name must be string");
25743  return -1;
25744  }
25745  r = __Pyx_GetAttr(o, n);
25746  if (unlikely(!r)) {
25747  PyErr_Clear();
25748  return 0;
25749  } else {
25750  Py_DECREF(r);
25751  return 1;
25752  }
25753 }
25754 
25755 /* CallNextTpDealloc */
25756 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
25757  PyTypeObject* type = Py_TYPE(obj);
25758  while (type && type->tp_dealloc != current_tp_dealloc)
25759  type = type->tp_base;
25760  while (type && type->tp_dealloc == current_tp_dealloc)
25761  type = type->tp_base;
25762  if (type)
25763  type->tp_dealloc(obj);
25764 }
25765 
25766 /* CallNextTpTraverse */
25767 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
25768  PyTypeObject* type = Py_TYPE(obj);
25769  while (type && type->tp_traverse != current_tp_traverse)
25770  type = type->tp_base;
25771  while (type && type->tp_traverse == current_tp_traverse)
25772  type = type->tp_base;
25773  if (type && type->tp_traverse)
25774  return type->tp_traverse(obj, v, a);
25775  return 0;
25776 }
25777 
25778 /* CallNextTpClear */
25779 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
25780  PyTypeObject* type = Py_TYPE(obj);
25781  while (type && type->tp_clear != current_tp_clear)
25782  type = type->tp_base;
25783  while (type && type->tp_clear == current_tp_clear)
25784  type = type->tp_base;
25785  if (type && type->tp_clear)
25786  type->tp_clear(obj);
25787 }
25788 
25789 /* PyObject_GenericGetAttrNoDict */
25790 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25791 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25792  PyErr_Format(PyExc_AttributeError,
25793 #if PY_MAJOR_VERSION >= 3
25794  "'%.50s' object has no attribute '%U'",
25795  tp->tp_name, attr_name);
25796 #else
25797  "'%.50s' object has no attribute '%.400s'",
25798  tp->tp_name, PyString_AS_STRING(attr_name));
25799 #endif
25800  return NULL;
25801 }
25802 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25803  PyObject *descr;
25804  PyTypeObject *tp = Py_TYPE(obj);
25805  if (unlikely(!PyString_Check(attr_name))) {
25806  return PyObject_GenericGetAttr(obj, attr_name);
25807  }
25808  assert(!tp->tp_dictoffset);
25809  descr = _PyType_Lookup(tp, attr_name);
25810  if (unlikely(!descr)) {
25811  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25812  }
25813  Py_INCREF(descr);
25814  #if PY_MAJOR_VERSION < 3
25815  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25816  #endif
25817  {
25818  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25819  if (unlikely(f)) {
25820  PyObject *res = f(descr, obj, (PyObject *)tp);
25821  Py_DECREF(descr);
25822  return res;
25823  }
25824  }
25825  return descr;
25826 }
25827 #endif
25828 
25829 /* PyObject_GenericGetAttr */
25830 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25831 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25832  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25833  return PyObject_GenericGetAttr(obj, attr_name);
25834  }
25835  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25836 }
25837 #endif
25838 
25839 /* TypeImport */
25840 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
25841 #define __PYX_HAVE_RT_ImportType_0_29_36
25842 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name,
25843  size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
25844 {
25845  PyObject *result = 0;
25846  char warning[200];
25847  Py_ssize_t basicsize;
25848  Py_ssize_t itemsize;
25849 #ifdef Py_LIMITED_API
25850  PyObject *py_basicsize;
25851  PyObject *py_itemsize;
25852 #endif
25853  result = PyObject_GetAttrString(module, class_name);
25854  if (!result)
25855  goto bad;
25856  if (!PyType_Check(result)) {
25857  PyErr_Format(PyExc_TypeError,
25858  "%.200s.%.200s is not a type object",
25859  module_name, class_name);
25860  goto bad;
25861  }
25862 #ifndef Py_LIMITED_API
25863  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25864  itemsize = ((PyTypeObject *)result)->tp_itemsize;
25865 #else
25866  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25867  if (!py_basicsize)
25868  goto bad;
25869  basicsize = PyLong_AsSsize_t(py_basicsize);
25870  Py_DECREF(py_basicsize);
25871  py_basicsize = 0;
25872  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25873  goto bad;
25874  py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
25875  if (!py_itemsize)
25876  goto bad;
25877  itemsize = PyLong_AsSsize_t(py_itemsize);
25878  Py_DECREF(py_itemsize);
25879  py_itemsize = 0;
25880  if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
25881  goto bad;
25882 #endif
25883  if (itemsize) {
25884  if (size % alignment) {
25885  alignment = size % alignment;
25886  }
25887  if (itemsize < (Py_ssize_t)alignment)
25888  itemsize = (Py_ssize_t)alignment;
25889  }
25890  if ((size_t)(basicsize + itemsize) < size) {
25891  PyErr_Format(PyExc_ValueError,
25892  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25893  "Expected %zd from C header, got %zd from PyObject",
25894  module_name, class_name, size, basicsize);
25895  goto bad;
25896  }
25897  if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) {
25898  PyErr_Format(PyExc_ValueError,
25899  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25900  "Expected %zd from C header, got %zd from PyObject",
25901  module_name, class_name, size, basicsize);
25902  goto bad;
25903  }
25904  else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) {
25905  PyOS_snprintf(warning, sizeof(warning),
25906  "%s.%s size changed, may indicate binary incompatibility. "
25907  "Expected %zd from C header, got %zd from PyObject",
25908  module_name, class_name, size, basicsize);
25909  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25910  }
25911  return (PyTypeObject *)result;
25912 bad:
25913  Py_XDECREF(result);
25914  return NULL;
25915 }
25916 #endif
25917 
25918 /* GetVTable */
25919 static void* __Pyx_GetVtable(PyObject *dict) {
25920  void* ptr;
25921  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
25922  if (!ob)
25923  goto bad;
25924 #if PY_VERSION_HEX >= 0x02070000
25925  ptr = PyCapsule_GetPointer(ob, 0);
25926 #else
25927  ptr = PyCObject_AsVoidPtr(ob);
25928 #endif
25929  if (!ptr && !PyErr_Occurred())
25930  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
25931  Py_DECREF(ob);
25932  return ptr;
25933 bad:
25934  Py_XDECREF(ob);
25935  return NULL;
25936 }
25937 
25938 /* SetVTable */
25939 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25940 #if PY_VERSION_HEX >= 0x02070000
25941  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25942 #else
25943  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25944 #endif
25945  if (!ob)
25946  goto bad;
25947  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25948  goto bad;
25949  Py_DECREF(ob);
25950  return 0;
25951 bad:
25952  Py_XDECREF(ob);
25953  return -1;
25954 }
25955 
25956 /* PyObjectGetAttrStrNoError */
25957 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25958  __Pyx_PyThreadState_declare
25959  __Pyx_PyThreadState_assign
25960  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25961  __Pyx_PyErr_Clear();
25962 }
25963 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25964  PyObject *result;
25965 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25966  PyTypeObject* tp = Py_TYPE(obj);
25967  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25968  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25969  }
25970 #endif
25971  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25972  if (unlikely(!result)) {
25973  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25974  }
25975  return result;
25976 }
25977 
25978 /* SetupReduce */
25979 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25980  int ret;
25981  PyObject *name_attr;
25982  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25983  if (likely(name_attr)) {
25984  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25985  } else {
25986  ret = -1;
25987  }
25988  if (unlikely(ret < 0)) {
25989  PyErr_Clear();
25990  ret = 0;
25991  }
25992  Py_XDECREF(name_attr);
25993  return ret;
25994 }
25995 static int __Pyx_setup_reduce(PyObject* type_obj) {
25996  int ret = 0;
25997  PyObject *object_reduce = NULL;
25998  PyObject *object_getstate = NULL;
25999  PyObject *object_reduce_ex = NULL;
26000  PyObject *reduce = NULL;
26001  PyObject *reduce_ex = NULL;
26002  PyObject *reduce_cython = NULL;
26003  PyObject *setstate = NULL;
26004  PyObject *setstate_cython = NULL;
26005  PyObject *getstate = NULL;
26006 #if CYTHON_USE_PYTYPE_LOOKUP
26007  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
26008 #else
26009  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
26010  if (!getstate && PyErr_Occurred()) {
26011  goto __PYX_BAD;
26012  }
26013 #endif
26014  if (getstate) {
26015 #if CYTHON_USE_PYTYPE_LOOKUP
26016  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
26017 #else
26018  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
26019  if (!object_getstate && PyErr_Occurred()) {
26020  goto __PYX_BAD;
26021  }
26022 #endif
26023  if (object_getstate != getstate) {
26024  goto __PYX_GOOD;
26025  }
26026  }
26027 #if CYTHON_USE_PYTYPE_LOOKUP
26028  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26029 #else
26030  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26031 #endif
26032  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
26033  if (reduce_ex == object_reduce_ex) {
26034 #if CYTHON_USE_PYTYPE_LOOKUP
26035  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26036 #else
26037  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26038 #endif
26039  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
26040  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26041  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26042  if (likely(reduce_cython)) {
26043  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26044  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26045  } else if (reduce == object_reduce || PyErr_Occurred()) {
26046  goto __PYX_BAD;
26047  }
26048  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26049  if (!setstate) PyErr_Clear();
26050  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26051  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26052  if (likely(setstate_cython)) {
26053  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26054  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26055  } else if (!setstate || PyErr_Occurred()) {
26056  goto __PYX_BAD;
26057  }
26058  }
26059  PyType_Modified((PyTypeObject*)type_obj);
26060  }
26061  }
26062  goto __PYX_GOOD;
26063 __PYX_BAD:
26064  if (!PyErr_Occurred())
26065  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26066  ret = -1;
26067 __PYX_GOOD:
26068 #if !CYTHON_USE_PYTYPE_LOOKUP
26069  Py_XDECREF(object_reduce);
26070  Py_XDECREF(object_reduce_ex);
26071  Py_XDECREF(object_getstate);
26072  Py_XDECREF(getstate);
26073 #endif
26074  Py_XDECREF(reduce);
26075  Py_XDECREF(reduce_ex);
26076  Py_XDECREF(reduce_cython);
26077  Py_XDECREF(setstate);
26078  Py_XDECREF(setstate_cython);
26079  return ret;
26080 }
26081 
26082 /* FetchCommonType */
26083 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26084  PyObject* fake_module;
26085  PyTypeObject* cached_type = NULL;
26086  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
26087  if (!fake_module) return NULL;
26088  Py_INCREF(fake_module);
26089  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26090  if (cached_type) {
26091  if (!PyType_Check((PyObject*)cached_type)) {
26092  PyErr_Format(PyExc_TypeError,
26093  "Shared Cython type %.200s is not a type object",
26094  type->tp_name);
26095  goto bad;
26096  }
26097  if (cached_type->tp_basicsize != type->tp_basicsize) {
26098  PyErr_Format(PyExc_TypeError,
26099  "Shared Cython type %.200s has the wrong size, try recompiling",
26100  type->tp_name);
26101  goto bad;
26102  }
26103  } else {
26104  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
26105  PyErr_Clear();
26106  if (PyType_Ready(type) < 0) goto bad;
26107  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26108  goto bad;
26109  Py_INCREF(type);
26110  cached_type = type;
26111  }
26112 done:
26113  Py_DECREF(fake_module);
26114  return cached_type;
26115 bad:
26116  Py_XDECREF(cached_type);
26117  cached_type = NULL;
26118  goto done;
26119 }
26120 
26121 /* CythonFunctionShared */
26122 #include <structmember.h>
26123 static PyObject *
26124 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
26125 {
26126  if (unlikely(op->func_doc == NULL)) {
26127  if (op->func.m_ml->ml_doc) {
26128 #if PY_MAJOR_VERSION >= 3
26129  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26130 #else
26131  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26132 #endif
26133  if (unlikely(op->func_doc == NULL))
26134  return NULL;
26135  } else {
26136  Py_INCREF(Py_None);
26137  return Py_None;
26138  }
26139  }
26140  Py_INCREF(op->func_doc);
26141  return op->func_doc;
26142 }
26143 static int
26144 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26145 {
26146  PyObject *tmp = op->func_doc;
26147  if (value == NULL) {
26148  value = Py_None;
26149  }
26150  Py_INCREF(value);
26151  op->func_doc = value;
26152  Py_XDECREF(tmp);
26153  return 0;
26154 }
26155 static PyObject *
26156 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26157 {
26158  if (unlikely(op->func_name == NULL)) {
26159 #if PY_MAJOR_VERSION >= 3
26160  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26161 #else
26162  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26163 #endif
26164  if (unlikely(op->func_name == NULL))
26165  return NULL;
26166  }
26167  Py_INCREF(op->func_name);
26168  return op->func_name;
26169 }
26170 static int
26171 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26172 {
26173  PyObject *tmp;
26174 #if PY_MAJOR_VERSION >= 3
26175  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26176 #else
26177  if (unlikely(value == NULL || !PyString_Check(value)))
26178 #endif
26179  {
26180  PyErr_SetString(PyExc_TypeError,
26181  "__name__ must be set to a string object");
26182  return -1;
26183  }
26184  tmp = op->func_name;
26185  Py_INCREF(value);
26186  op->func_name = value;
26187  Py_XDECREF(tmp);
26188  return 0;
26189 }
26190 static PyObject *
26191 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26192 {
26193  Py_INCREF(op->func_qualname);
26194  return op->func_qualname;
26195 }
26196 static int
26197 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26198 {
26199  PyObject *tmp;
26200 #if PY_MAJOR_VERSION >= 3
26201  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26202 #else
26203  if (unlikely(value == NULL || !PyString_Check(value)))
26204 #endif
26205  {
26206  PyErr_SetString(PyExc_TypeError,
26207  "__qualname__ must be set to a string object");
26208  return -1;
26209  }
26210  tmp = op->func_qualname;
26211  Py_INCREF(value);
26212  op->func_qualname = value;
26213  Py_XDECREF(tmp);
26214  return 0;
26215 }
26216 static PyObject *
26217 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
26218 {
26219  PyObject *self;
26220  self = m->func_closure;
26221  if (self == NULL)
26222  self = Py_None;
26223  Py_INCREF(self);
26224  return self;
26225 }
26226 static PyObject *
26227 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26228 {
26229  if (unlikely(op->func_dict == NULL)) {
26230  op->func_dict = PyDict_New();
26231  if (unlikely(op->func_dict == NULL))
26232  return NULL;
26233  }
26234  Py_INCREF(op->func_dict);
26235  return op->func_dict;
26236 }
26237 static int
26238 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26239 {
26240  PyObject *tmp;
26241  if (unlikely(value == NULL)) {
26242  PyErr_SetString(PyExc_TypeError,
26243  "function's dictionary may not be deleted");
26244  return -1;
26245  }
26246  if (unlikely(!PyDict_Check(value))) {
26247  PyErr_SetString(PyExc_TypeError,
26248  "setting function's dictionary to a non-dict");
26249  return -1;
26250  }
26251  tmp = op->func_dict;
26252  Py_INCREF(value);
26253  op->func_dict = value;
26254  Py_XDECREF(tmp);
26255  return 0;
26256 }
26257 static PyObject *
26258 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26259 {
26260  Py_INCREF(op->func_globals);
26261  return op->func_globals;
26262 }
26263 static PyObject *
26264 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26265 {
26266  Py_INCREF(Py_None);
26267  return Py_None;
26268 }
26269 static PyObject *
26270 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26271 {
26272  PyObject* result = (op->func_code) ? op->func_code : Py_None;
26273  Py_INCREF(result);
26274  return result;
26275 }
26276 static int
26277 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26278  int result = 0;
26279  PyObject *res = op->defaults_getter((PyObject *) op);
26280  if (unlikely(!res))
26281  return -1;
26282  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26283  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26284  Py_INCREF(op->defaults_tuple);
26285  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26286  Py_INCREF(op->defaults_kwdict);
26287  #else
26288  op->defaults_tuple = PySequence_ITEM(res, 0);
26289  if (unlikely(!op->defaults_tuple)) result = -1;
26290  else {
26291  op->defaults_kwdict = PySequence_ITEM(res, 1);
26292  if (unlikely(!op->defaults_kwdict)) result = -1;
26293  }
26294  #endif
26295  Py_DECREF(res);
26296  return result;
26297 }
26298 static int
26299 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26300  PyObject* tmp;
26301  if (!value) {
26302  value = Py_None;
26303  } else if (value != Py_None && !PyTuple_Check(value)) {
26304  PyErr_SetString(PyExc_TypeError,
26305  "__defaults__ must be set to a tuple object");
26306  return -1;
26307  }
26308  Py_INCREF(value);
26309  tmp = op->defaults_tuple;
26310  op->defaults_tuple = value;
26311  Py_XDECREF(tmp);
26312  return 0;
26313 }
26314 static PyObject *
26315 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26316  PyObject* result = op->defaults_tuple;
26317  if (unlikely(!result)) {
26318  if (op->defaults_getter) {
26319  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26320  result = op->defaults_tuple;
26321  } else {
26322  result = Py_None;
26323  }
26324  }
26325  Py_INCREF(result);
26326  return result;
26327 }
26328 static int
26329 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26330  PyObject* tmp;
26331  if (!value) {
26332  value = Py_None;
26333  } else if (value != Py_None && !PyDict_Check(value)) {
26334  PyErr_SetString(PyExc_TypeError,
26335  "__kwdefaults__ must be set to a dict object");
26336  return -1;
26337  }
26338  Py_INCREF(value);
26339  tmp = op->defaults_kwdict;
26340  op->defaults_kwdict = value;
26341  Py_XDECREF(tmp);
26342  return 0;
26343 }
26344 static PyObject *
26345 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26346  PyObject* result = op->defaults_kwdict;
26347  if (unlikely(!result)) {
26348  if (op->defaults_getter) {
26349  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26350  result = op->defaults_kwdict;
26351  } else {
26352  result = Py_None;
26353  }
26354  }
26355  Py_INCREF(result);
26356  return result;
26357 }
26358 static int
26359 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26360  PyObject* tmp;
26361  if (!value || value == Py_None) {
26362  value = NULL;
26363  } else if (!PyDict_Check(value)) {
26364  PyErr_SetString(PyExc_TypeError,
26365  "__annotations__ must be set to a dict object");
26366  return -1;
26367  }
26368  Py_XINCREF(value);
26369  tmp = op->func_annotations;
26370  op->func_annotations = value;
26371  Py_XDECREF(tmp);
26372  return 0;
26373 }
26374 static PyObject *
26375 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26376  PyObject* result = op->func_annotations;
26377  if (unlikely(!result)) {
26378  result = PyDict_New();
26379  if (unlikely(!result)) return NULL;
26380  op->func_annotations = result;
26381  }
26382  Py_INCREF(result);
26383  return result;
26384 }
26385 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26386  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26387  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26388  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26389  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26390  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26391  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26392  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26393  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26394  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26395  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26396  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26397  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26398  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26399  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26400  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26401  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26402  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26403  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26404  {0, 0, 0, 0, 0}
26405 };
26406 static PyMemberDef __pyx_CyFunction_members[] = {
26407  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26408  {0, 0, 0, 0, 0}
26409 };
26410 static PyObject *
26411 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26412 {
26413 #if PY_MAJOR_VERSION >= 3
26414  Py_INCREF(m->func_qualname);
26415  return m->func_qualname;
26416 #else
26417  return PyString_FromString(m->func.m_ml->ml_name);
26418 #endif
26419 }
26420 static PyMethodDef __pyx_CyFunction_methods[] = {
26421  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26422  {0, 0, 0, 0}
26423 };
26424 #if PY_VERSION_HEX < 0x030500A0
26425 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26426 #else
26427 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26428 #endif
26429 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
26430  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26431  if (unlikely(op == NULL))
26432  return NULL;
26433  op->flags = flags;
26434  __Pyx_CyFunction_weakreflist(op) = NULL;
26435  op->func.m_ml = ml;
26436  op->func.m_self = (PyObject *) op;
26437  Py_XINCREF(closure);
26438  op->func_closure = closure;
26439  Py_XINCREF(module);
26440  op->func.m_module = module;
26441  op->func_dict = NULL;
26442  op->func_name = NULL;
26443  Py_INCREF(qualname);
26444  op->func_qualname = qualname;
26445  op->func_doc = NULL;
26446  op->func_classobj = NULL;
26447  op->func_globals = globals;
26448  Py_INCREF(op->func_globals);
26449  Py_XINCREF(code);
26450  op->func_code = code;
26451  op->defaults_pyobjects = 0;
26452  op->defaults_size = 0;
26453  op->defaults = NULL;
26454  op->defaults_tuple = NULL;
26455  op->defaults_kwdict = NULL;
26456  op->defaults_getter = NULL;
26457  op->func_annotations = NULL;
26458  return (PyObject *) op;
26459 }
26460 static int
26461 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26462 {
26463  Py_CLEAR(m->func_closure);
26464  Py_CLEAR(m->func.m_module);
26465  Py_CLEAR(m->func_dict);
26466  Py_CLEAR(m->func_name);
26467  Py_CLEAR(m->func_qualname);
26468  Py_CLEAR(m->func_doc);
26469  Py_CLEAR(m->func_globals);
26470  Py_CLEAR(m->func_code);
26471  Py_CLEAR(m->func_classobj);
26472  Py_CLEAR(m->defaults_tuple);
26473  Py_CLEAR(m->defaults_kwdict);
26474  Py_CLEAR(m->func_annotations);
26475  if (m->defaults) {
26476  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26477  int i;
26478  for (i = 0; i < m->defaults_pyobjects; i++)
26479  Py_XDECREF(pydefaults[i]);
26480  PyObject_Free(m->defaults);
26481  m->defaults = NULL;
26482  }
26483  return 0;
26484 }
26485 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26486 {
26487  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26488  PyObject_ClearWeakRefs((PyObject *) m);
26489  __Pyx_CyFunction_clear(m);
26490  PyObject_GC_Del(m);
26491 }
26492 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26493 {
26494  PyObject_GC_UnTrack(m);
26495  __Pyx__CyFunction_dealloc(m);
26496 }
26497 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26498 {
26499  Py_VISIT(m->func_closure);
26500  Py_VISIT(m->func.m_module);
26501  Py_VISIT(m->func_dict);
26502  Py_VISIT(m->func_name);
26503  Py_VISIT(m->func_qualname);
26504  Py_VISIT(m->func_doc);
26505  Py_VISIT(m->func_globals);
26506  Py_VISIT(m->func_code);
26507  Py_VISIT(m->func_classobj);
26508  Py_VISIT(m->defaults_tuple);
26509  Py_VISIT(m->defaults_kwdict);
26510  if (m->defaults) {
26511  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26512  int i;
26513  for (i = 0; i < m->defaults_pyobjects; i++)
26514  Py_VISIT(pydefaults[i]);
26515  }
26516  return 0;
26517 }
26518 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26519 {
26520 #if PY_MAJOR_VERSION < 3
26521  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26522  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26523  Py_INCREF(func);
26524  return func;
26525  }
26526  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26527  if (type == NULL)
26528  type = (PyObject *)(Py_TYPE(obj));
26529  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26530  }
26531  if (obj == Py_None)
26532  obj = NULL;
26533 #endif
26534  return __Pyx_PyMethod_New(func, obj, type);
26535 }
26536 static PyObject*
26537 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26538 {
26539 #if PY_MAJOR_VERSION >= 3
26540  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26541  op->func_qualname, (void *)op);
26542 #else
26543  return PyString_FromFormat("<cyfunction %s at %p>",
26544  PyString_AsString(op->func_qualname), (void *)op);
26545 #endif
26546 }
26547 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26548  PyCFunctionObject* f = (PyCFunctionObject*)func;
26549  PyCFunction meth = f->m_ml->ml_meth;
26550  Py_ssize_t size;
26551  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26552  case METH_VARARGS:
26553  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26554  return (*meth)(self, arg);
26555  break;
26556  case METH_VARARGS | METH_KEYWORDS:
26557  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26558  case METH_NOARGS:
26559  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26560  size = PyTuple_GET_SIZE(arg);
26561  if (likely(size == 0))
26562  return (*meth)(self, NULL);
26563  PyErr_Format(PyExc_TypeError,
26564  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26565  f->m_ml->ml_name, size);
26566  return NULL;
26567  }
26568  break;
26569  case METH_O:
26570  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26571  size = PyTuple_GET_SIZE(arg);
26572  if (likely(size == 1)) {
26573  PyObject *result, *arg0;
26574  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26575  arg0 = PyTuple_GET_ITEM(arg, 0);
26576  #else
26577  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26578  #endif
26579  result = (*meth)(self, arg0);
26580  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26581  Py_DECREF(arg0);
26582  #endif
26583  return result;
26584  }
26585  PyErr_Format(PyExc_TypeError,
26586  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26587  f->m_ml->ml_name, size);
26588  return NULL;
26589  }
26590  break;
26591  default:
26592  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26593  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26594  "longer supported!");
26595  return NULL;
26596  }
26597  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26598  f->m_ml->ml_name);
26599  return NULL;
26600 }
26601 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26602  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26603 }
26604 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26605  PyObject *result;
26606  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26607  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26608  Py_ssize_t argc;
26609  PyObject *new_args;
26610  PyObject *self;
26611  argc = PyTuple_GET_SIZE(args);
26612  new_args = PyTuple_GetSlice(args, 1, argc);
26613  if (unlikely(!new_args))
26614  return NULL;
26615  self = PyTuple_GetItem(args, 0);
26616  if (unlikely(!self)) {
26617  Py_DECREF(new_args);
26618 #if PY_MAJOR_VERSION > 2
26619  PyErr_Format(PyExc_TypeError,
26620  "unbound method %.200S() needs an argument",
26621  cyfunc->func_qualname);
26622 #else
26623  PyErr_SetString(PyExc_TypeError,
26624  "unbound method needs an argument");
26625 #endif
26626  return NULL;
26627  }
26628  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26629  Py_DECREF(new_args);
26630  } else {
26631  result = __Pyx_CyFunction_Call(func, args, kw);
26632  }
26633  return result;
26634 }
26635 static PyTypeObject __pyx_CyFunctionType_type = {
26636  PyVarObject_HEAD_INIT(0, 0)
26637  "cython_function_or_method",
26638  sizeof(__pyx_CyFunctionObject),
26639  0,
26640  (destructor) __Pyx_CyFunction_dealloc,
26641  0,
26642  0,
26643  0,
26644 #if PY_MAJOR_VERSION < 3
26645  0,
26646 #else
26647  0,
26648 #endif
26649  (reprfunc) __Pyx_CyFunction_repr,
26650  0,
26651  0,
26652  0,
26653  0,
26654  __Pyx_CyFunction_CallAsMethod,
26655  0,
26656  0,
26657  0,
26658  0,
26659  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26660  0,
26661  (traverseproc) __Pyx_CyFunction_traverse,
26662  (inquiry) __Pyx_CyFunction_clear,
26663  0,
26664 #if PY_VERSION_HEX < 0x030500A0
26665  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26666 #else
26667  offsetof(PyCFunctionObject, m_weakreflist),
26668 #endif
26669  0,
26670  0,
26671  __pyx_CyFunction_methods,
26672  __pyx_CyFunction_members,
26673  __pyx_CyFunction_getsets,
26674  0,
26675  0,
26676  __Pyx_CyFunction_descr_get,
26677  0,
26678  offsetof(__pyx_CyFunctionObject, func_dict),
26679  0,
26680  0,
26681  0,
26682  0,
26683  0,
26684  0,
26685  0,
26686  0,
26687  0,
26688  0,
26689  0,
26690  0,
26691 #if PY_VERSION_HEX >= 0x030400a1
26692  0,
26693 #endif
26694 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26695  0,
26696 #endif
26697 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26698  0,
26699 #endif
26700 #if PY_VERSION_HEX >= 0x030C0000
26701  0,
26702 #endif
26703 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26704  0,
26705 #endif
26706 };
26707 static int __pyx_CyFunction_init(void) {
26708  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26709  if (unlikely(__pyx_CyFunctionType == NULL)) {
26710  return -1;
26711  }
26712  return 0;
26713 }
26714 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26715  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26716  m->defaults = PyObject_Malloc(size);
26717  if (unlikely(!m->defaults))
26718  return PyErr_NoMemory();
26719  memset(m->defaults, 0, size);
26720  m->defaults_pyobjects = pyobjects;
26721  m->defaults_size = size;
26722  return m->defaults;
26723 }
26724 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26725  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26726  m->defaults_tuple = tuple;
26727  Py_INCREF(tuple);
26728 }
26729 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26730  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26731  m->defaults_kwdict = dict;
26732  Py_INCREF(dict);
26733 }
26734 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26735  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26736  m->func_annotations = dict;
26737  Py_INCREF(dict);
26738 }
26739 
26740 /* CythonFunction */
26741 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26742  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26743  PyObject *op = __Pyx_CyFunction_Init(
26744  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26745  ml, flags, qualname, closure, module, globals, code
26746  );
26747  if (likely(op)) {
26748  PyObject_GC_Track(op);
26749  }
26750  return op;
26751 }
26752 
26753 /* CLineInTraceback */
26754 #ifndef CYTHON_CLINE_IN_TRACEBACK
26755 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
26756  PyObject *use_cline;
26757  PyObject *ptype, *pvalue, *ptraceback;
26758 #if CYTHON_COMPILING_IN_CPYTHON
26759  PyObject **cython_runtime_dict;
26760 #endif
26761  if (unlikely(!__pyx_cython_runtime)) {
26762  return c_line;
26763  }
26764  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26765 #if CYTHON_COMPILING_IN_CPYTHON
26766  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26767  if (likely(cython_runtime_dict)) {
26768  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26769  use_cline, *cython_runtime_dict,
26770  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26771  } else
26772 #endif
26773  {
26774  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26775  if (use_cline_obj) {
26776  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26777  Py_DECREF(use_cline_obj);
26778  } else {
26779  PyErr_Clear();
26780  use_cline = NULL;
26781  }
26782  }
26783  if (!use_cline) {
26784  c_line = 0;
26785  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26786  }
26787  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26788  c_line = 0;
26789  }
26790  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26791  return c_line;
26792 }
26793 #endif
26794 
26795 /* CodeObjectCache */
26796 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26797  int start = 0, mid = 0, end = count - 1;
26798  if (end >= 0 && code_line > entries[end].code_line) {
26799  return count;
26800  }
26801  while (start < end) {
26802  mid = start + (end - start) / 2;
26803  if (code_line < entries[mid].code_line) {
26804  end = mid;
26805  } else if (code_line > entries[mid].code_line) {
26806  start = mid + 1;
26807  } else {
26808  return mid;
26809  }
26810  }
26811  if (code_line <= entries[mid].code_line) {
26812  return mid;
26813  } else {
26814  return mid + 1;
26815  }
26816 }
26817 static PyCodeObject *__pyx_find_code_object(int code_line) {
26818  PyCodeObject* code_object;
26819  int pos;
26820  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26821  return NULL;
26822  }
26823  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26824  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26825  return NULL;
26826  }
26827  code_object = __pyx_code_cache.entries[pos].code_object;
26828  Py_INCREF(code_object);
26829  return code_object;
26830 }
26831 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26832  int pos, i;
26833  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26834  if (unlikely(!code_line)) {
26835  return;
26836  }
26837  if (unlikely(!entries)) {
26838  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26839  if (likely(entries)) {
26840  __pyx_code_cache.entries = entries;
26841  __pyx_code_cache.max_count = 64;
26842  __pyx_code_cache.count = 1;
26843  entries[0].code_line = code_line;
26844  entries[0].code_object = code_object;
26845  Py_INCREF(code_object);
26846  }
26847  return;
26848  }
26849  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26850  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26851  PyCodeObject* tmp = entries[pos].code_object;
26852  entries[pos].code_object = code_object;
26853  Py_DECREF(tmp);
26854  return;
26855  }
26856  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26857  int new_max = __pyx_code_cache.max_count + 64;
26858  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26859  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26860  if (unlikely(!entries)) {
26861  return;
26862  }
26863  __pyx_code_cache.entries = entries;
26864  __pyx_code_cache.max_count = new_max;
26865  }
26866  for (i=__pyx_code_cache.count; i>pos; i--) {
26867  entries[i] = entries[i-1];
26868  }
26869  entries[pos].code_line = code_line;
26870  entries[pos].code_object = code_object;
26871  __pyx_code_cache.count++;
26872  Py_INCREF(code_object);
26873 }
26874 
26875 /* AddTraceback */
26876 #include "compile.h"
26877 #include "frameobject.h"
26878 #include "traceback.h"
26879 #if PY_VERSION_HEX >= 0x030b00a6
26880  #ifndef Py_BUILD_CORE
26881  #define Py_BUILD_CORE 1
26882  #endif
26883  #include "internal/pycore_frame.h"
26884 #endif
26885 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26886  const char *funcname, int c_line,
26887  int py_line, const char *filename) {
26888  PyCodeObject *py_code = NULL;
26889  PyObject *py_funcname = NULL;
26890  #if PY_MAJOR_VERSION < 3
26891  PyObject *py_srcfile = NULL;
26892  py_srcfile = PyString_FromString(filename);
26893  if (!py_srcfile) goto bad;
26894  #endif
26895  if (c_line) {
26896  #if PY_MAJOR_VERSION < 3
26897  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26898  if (!py_funcname) goto bad;
26899  #else
26900  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26901  if (!py_funcname) goto bad;
26902  funcname = PyUnicode_AsUTF8(py_funcname);
26903  if (!funcname) goto bad;
26904  #endif
26905  }
26906  else {
26907  #if PY_MAJOR_VERSION < 3
26908  py_funcname = PyString_FromString(funcname);
26909  if (!py_funcname) goto bad;
26910  #endif
26911  }
26912  #if PY_MAJOR_VERSION < 3
26913  py_code = __Pyx_PyCode_New(
26914  0,
26915  0,
26916  0,
26917  0,
26918  0,
26919  __pyx_empty_bytes, /*PyObject *code,*/
26920  __pyx_empty_tuple, /*PyObject *consts,*/
26921  __pyx_empty_tuple, /*PyObject *names,*/
26922  __pyx_empty_tuple, /*PyObject *varnames,*/
26923  __pyx_empty_tuple, /*PyObject *freevars,*/
26924  __pyx_empty_tuple, /*PyObject *cellvars,*/
26925  py_srcfile, /*PyObject *filename,*/
26926  py_funcname, /*PyObject *name,*/
26927  py_line,
26928  __pyx_empty_bytes /*PyObject *lnotab*/
26929  );
26930  Py_DECREF(py_srcfile);
26931  #else
26932  py_code = PyCode_NewEmpty(filename, funcname, py_line);
26933  #endif
26934  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
26935  return py_code;
26936 bad:
26937  Py_XDECREF(py_funcname);
26938  #if PY_MAJOR_VERSION < 3
26939  Py_XDECREF(py_srcfile);
26940  #endif
26941  return NULL;
26942 }
26943 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26944  int py_line, const char *filename) {
26945  PyCodeObject *py_code = 0;
26946  PyFrameObject *py_frame = 0;
26947  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26948  PyObject *ptype, *pvalue, *ptraceback;
26949  if (c_line) {
26950  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26951  }
26952  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26953  if (!py_code) {
26954  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26955  py_code = __Pyx_CreateCodeObjectForTraceback(
26956  funcname, c_line, py_line, filename);
26957  if (!py_code) {
26958  /* If the code object creation fails, then we should clear the
26959  fetched exception references and propagate the new exception */
26960  Py_XDECREF(ptype);
26961  Py_XDECREF(pvalue);
26962  Py_XDECREF(ptraceback);
26963  goto bad;
26964  }
26965  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26966  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26967  }
26968  py_frame = PyFrame_New(
26969  tstate, /*PyThreadState *tstate,*/
26970  py_code, /*PyCodeObject *code,*/
26971  __pyx_d, /*PyObject *globals,*/
26972  0 /*PyObject *locals*/
26973  );
26974  if (!py_frame) goto bad;
26975  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26976  PyTraceBack_Here(py_frame);
26977 bad:
26978  Py_XDECREF(py_code);
26979  Py_XDECREF(py_frame);
26980 }
26981 
26982 #if PY_MAJOR_VERSION < 3
26983 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26984  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26985  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26986  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26987  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26988  return -1;
26989 }
26990 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26991  PyObject *obj = view->obj;
26992  if (!obj) return;
26993  if (PyObject_CheckBuffer(obj)) {
26994  PyBuffer_Release(view);
26995  return;
26996  }
26997  if ((0)) {}
26998  view->obj = NULL;
26999  Py_DECREF(obj);
27000 }
27001 #endif
27002 
27003 
27004 /* MemviewSliceIsContig */
27005 static int
27006 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27007 {
27008  int i, index, step, start;
27009  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27010  if (order == 'F') {
27011  step = 1;
27012  start = 0;
27013  } else {
27014  step = -1;
27015  start = ndim - 1;
27016  }
27017  for (i = 0; i < ndim; i++) {
27018  index = start + step * i;
27019  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27020  return 0;
27021  itemsize *= mvs.shape[index];
27022  }
27023  return 1;
27024 }
27025 
27026 /* OverlappingSlices */
27027 static void
27028 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27029  void **out_start, void **out_end,
27030  int ndim, size_t itemsize)
27031 {
27032  char *start, *end;
27033  int i;
27034  start = end = slice->data;
27035  for (i = 0; i < ndim; i++) {
27036  Py_ssize_t stride = slice->strides[i];
27037  Py_ssize_t extent = slice->shape[i];
27038  if (extent == 0) {
27039  *out_start = *out_end = start;
27040  return;
27041  } else {
27042  if (stride > 0)
27043  end += stride * (extent - 1);
27044  else
27045  start += stride * (extent - 1);
27046  }
27047  }
27048  *out_start = start;
27049  *out_end = end + itemsize;
27050 }
27051 static int
27052 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27053  __Pyx_memviewslice *slice2,
27054  int ndim, size_t itemsize)
27055 {
27056  void *start1, *end1, *start2, *end2;
27057  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27058  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27059  return (start1 < end2) && (start2 < end1);
27060 }
27061 
27062 /* Capsule */
27063 static CYTHON_INLINE PyObject *
27064 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27065 {
27066  PyObject *cobj;
27067 #if PY_VERSION_HEX >= 0x02070000
27068  cobj = PyCapsule_New(p, sig, NULL);
27069 #else
27070  cobj = PyCObject_FromVoidPtr(p, NULL);
27071 #endif
27072  return cobj;
27073 }
27074 
27075 /* CIntFromPyVerify */
27076 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27077  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27078 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27079  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27080 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27081  {\
27082  func_type value = func_value;\
27083  if (sizeof(target_type) < sizeof(func_type)) {\
27084  if (unlikely(value != (func_type) (target_type) value)) {\
27085  func_type zero = 0;\
27086  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27087  return (target_type) -1;\
27088  if (is_unsigned && unlikely(value < zero))\
27089  goto raise_neg_overflow;\
27090  else\
27091  goto raise_overflow;\
27092  }\
27093  }\
27094  return (target_type) value;\
27095  }
27096 
27097 /* IsLittleEndian */
27098 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
27099 {
27100  union {
27101  uint32_t u32;
27102  uint8_t u8[4];
27103  } S;
27104  S.u32 = 0x01020304;
27105  return S.u8[0] == 4;
27106 }
27107 
27108 /* BufferFormatCheck */
27109 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27110  __Pyx_BufFmt_StackElem* stack,
27111  __Pyx_TypeInfo* type) {
27112  stack[0].field = &ctx->root;
27113  stack[0].parent_offset = 0;
27114  ctx->root.type = type;
27115  ctx->root.name = "buffer dtype";
27116  ctx->root.offset = 0;
27117  ctx->head = stack;
27118  ctx->head->field = &ctx->root;
27119  ctx->fmt_offset = 0;
27120  ctx->head->parent_offset = 0;
27121  ctx->new_packmode = '@';
27122  ctx->enc_packmode = '@';
27123  ctx->new_count = 1;
27124  ctx->enc_count = 0;
27125  ctx->enc_type = 0;
27126  ctx->is_complex = 0;
27127  ctx->is_valid_array = 0;
27128  ctx->struct_alignment = 0;
27129  while (type->typegroup == 'S') {
27130  ++ctx->head;
27131  ctx->head->field = type->fields;
27132  ctx->head->parent_offset = 0;
27133  type = type->fields->type;
27134  }
27135 }
27136 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
27137  int count;
27138  const char* t = *ts;
27139  if (*t < '0' || *t > '9') {
27140  return -1;
27141  } else {
27142  count = *t++ - '0';
27143  while (*t >= '0' && *t <= '9') {
27144  count *= 10;
27145  count += *t++ - '0';
27146  }
27147  }
27148  *ts = t;
27149  return count;
27150 }
27151 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
27152  int number = __Pyx_BufFmt_ParseNumber(ts);
27153  if (number == -1)
27154  PyErr_Format(PyExc_ValueError,\
27155  "Does not understand character buffer dtype format string ('%c')", **ts);
27156  return number;
27157 }
27158 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
27159  PyErr_Format(PyExc_ValueError,
27160  "Unexpected format string character: '%c'", ch);
27161 }
27162 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
27163  switch (ch) {
27164  case '?': return "'bool'";
27165  case 'c': return "'char'";
27166  case 'b': return "'signed char'";
27167  case 'B': return "'unsigned char'";
27168  case 'h': return "'short'";
27169  case 'H': return "'unsigned short'";
27170  case 'i': return "'int'";
27171  case 'I': return "'unsigned int'";
27172  case 'l': return "'long'";
27173  case 'L': return "'unsigned long'";
27174  case 'q': return "'long long'";
27175  case 'Q': return "'unsigned long long'";
27176  case 'f': return (is_complex ? "'complex float'" : "'float'");
27177  case 'd': return (is_complex ? "'complex double'" : "'double'");
27178  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
27179  case 'T': return "a struct";
27180  case 'O': return "Python object";
27181  case 'P': return "a pointer";
27182  case 's': case 'p': return "a string";
27183  case 0: return "end";
27184  default: return "unparseable format string";
27185  }
27186 }
27187 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
27188  switch (ch) {
27189  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27190  case 'h': case 'H': return 2;
27191  case 'i': case 'I': case 'l': case 'L': return 4;
27192  case 'q': case 'Q': return 8;
27193  case 'f': return (is_complex ? 8 : 4);
27194  case 'd': return (is_complex ? 16 : 8);
27195  case 'g': {
27196  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
27197  return 0;
27198  }
27199  case 'O': case 'P': return sizeof(void*);
27200  default:
27201  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27202  return 0;
27203  }
27204 }
27205 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
27206  switch (ch) {
27207  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27208  case 'h': case 'H': return sizeof(short);
27209  case 'i': case 'I': return sizeof(int);
27210  case 'l': case 'L': return sizeof(long);
27211  #ifdef HAVE_LONG_LONG
27212  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
27213  #endif
27214  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
27215  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
27216  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
27217  case 'O': case 'P': return sizeof(void*);
27218  default: {
27219  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27220  return 0;
27221  }
27222  }
27223 }
27224 typedef struct { char c; short x; } __Pyx_st_short;
27225 typedef struct { char c; int x; } __Pyx_st_int;
27226 typedef struct { char c; long x; } __Pyx_st_long;
27227 typedef struct { char c; float x; } __Pyx_st_float;
27228 typedef struct { char c; double x; } __Pyx_st_double;
27229 typedef struct { char c; long double x; } __Pyx_st_longdouble;
27230 typedef struct { char c; void *x; } __Pyx_st_void_p;
27231 #ifdef HAVE_LONG_LONG
27232 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27233 #endif
27234 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
27235  switch (ch) {
27236  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27237  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
27238  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
27239  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
27240 #ifdef HAVE_LONG_LONG
27241  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
27242 #endif
27243  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
27244  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
27245  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
27246  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
27247  default:
27248  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27249  return 0;
27250  }
27251 }
27252 /* These are for computing the padding at the end of the struct to align
27253  on the first member of the struct. This will probably the same as above,
27254  but we don't have any guarantees.
27255  */
27256 typedef struct { short x; char c; } __Pyx_pad_short;
27257 typedef struct { int x; char c; } __Pyx_pad_int;
27258 typedef struct { long x; char c; } __Pyx_pad_long;
27259 typedef struct { float x; char c; } __Pyx_pad_float;
27260 typedef struct { double x; char c; } __Pyx_pad_double;
27261 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
27262 typedef struct { void *x; char c; } __Pyx_pad_void_p;
27263 #ifdef HAVE_LONG_LONG
27264 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
27265 #endif
27266 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
27267  switch (ch) {
27268  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27269  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
27270  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
27271  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
27272 #ifdef HAVE_LONG_LONG
27273  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
27274 #endif
27275  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
27276  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
27277  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
27278  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
27279  default:
27280  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27281  return 0;
27282  }
27283 }
27284 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
27285  switch (ch) {
27286  case 'c':
27287  return 'H';
27288  case 'b': case 'h': case 'i':
27289  case 'l': case 'q': case 's': case 'p':
27290  return 'I';
27291  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
27292  return 'U';
27293  case 'f': case 'd': case 'g':
27294  return (is_complex ? 'C' : 'R');
27295  case 'O':
27296  return 'O';
27297  case 'P':
27298  return 'P';
27299  default: {
27300  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27301  return 0;
27302  }
27303  }
27304 }
27305 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27306  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27307  const char* expected;
27308  const char* quote;
27309  if (ctx->head == NULL) {
27310  expected = "end";
27311  quote = "";
27312  } else {
27313  expected = ctx->head->field->type->name;
27314  quote = "'";
27315  }
27316  PyErr_Format(PyExc_ValueError,
27317  "Buffer dtype mismatch, expected %s%s%s but got %s",
27318  quote, expected, quote,
27319  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27320  } else {
27321  __Pyx_StructField* field = ctx->head->field;
27322  __Pyx_StructField* parent = (ctx->head - 1)->field;
27323  PyErr_Format(PyExc_ValueError,
27324  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27325  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27326  parent->type->name, field->name);
27327  }
27328 }
27329 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27330  char group;
27331  size_t size, offset, arraysize = 1;
27332  if (ctx->enc_type == 0) return 0;
27333  if (ctx->head->field->type->arraysize[0]) {
27334  int i, ndim = 0;
27335  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27336  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27337  ndim = 1;
27338  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27339  PyErr_Format(PyExc_ValueError,
27340  "Expected a dimension of size %zu, got %zu",
27341  ctx->head->field->type->arraysize[0], ctx->enc_count);
27342  return -1;
27343  }
27344  }
27345  if (!ctx->is_valid_array) {
27346  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27347  ctx->head->field->type->ndim, ndim);
27348  return -1;
27349  }
27350  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27351  arraysize *= ctx->head->field->type->arraysize[i];
27352  }
27353  ctx->is_valid_array = 0;
27354  ctx->enc_count = 1;
27355  }
27356  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27357  do {
27358  __Pyx_StructField* field = ctx->head->field;
27359  __Pyx_TypeInfo* type = field->type;
27360  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27361  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27362  } else {
27363  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27364  }
27365  if (ctx->enc_packmode == '@') {
27366  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27367  size_t align_mod_offset;
27368  if (align_at == 0) return -1;
27369  align_mod_offset = ctx->fmt_offset % align_at;
27370  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27371  if (ctx->struct_alignment == 0)
27372  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27373  ctx->is_complex);
27374  }
27375  if (type->size != size || type->typegroup != group) {
27376  if (type->typegroup == 'C' && type->fields != NULL) {
27377  size_t parent_offset = ctx->head->parent_offset + field->offset;
27378  ++ctx->head;
27379  ctx->head->field = type->fields;
27380  ctx->head->parent_offset = parent_offset;
27381  continue;
27382  }
27383  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27384  } else {
27385  __Pyx_BufFmt_RaiseExpected(ctx);
27386  return -1;
27387  }
27388  }
27389  offset = ctx->head->parent_offset + field->offset;
27390  if (ctx->fmt_offset != offset) {
27391  PyErr_Format(PyExc_ValueError,
27392  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27393  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27394  return -1;
27395  }
27396  ctx->fmt_offset += size;
27397  if (arraysize)
27398  ctx->fmt_offset += (arraysize - 1) * size;
27399  --ctx->enc_count;
27400  while (1) {
27401  if (field == &ctx->root) {
27402  ctx->head = NULL;
27403  if (ctx->enc_count != 0) {
27404  __Pyx_BufFmt_RaiseExpected(ctx);
27405  return -1;
27406  }
27407  break;
27408  }
27409  ctx->head->field = ++field;
27410  if (field->type == NULL) {
27411  --ctx->head;
27412  field = ctx->head->field;
27413  continue;
27414  } else if (field->type->typegroup == 'S') {
27415  size_t parent_offset = ctx->head->parent_offset + field->offset;
27416  if (field->type->fields->type == NULL) continue;
27417  field = field->type->fields;
27418  ++ctx->head;
27419  ctx->head->field = field;
27420  ctx->head->parent_offset = parent_offset;
27421  break;
27422  } else {
27423  break;
27424  }
27425  }
27426  } while (ctx->enc_count);
27427  ctx->enc_type = 0;
27428  ctx->is_complex = 0;
27429  return 0;
27430 }
27431 static PyObject *
27432 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27433 {
27434  const char *ts = *tsp;
27435  int i = 0, number, ndim;
27436  ++ts;
27437  if (ctx->new_count != 1) {
27438  PyErr_SetString(PyExc_ValueError,
27439  "Cannot handle repeated arrays in format string");
27440  return NULL;
27441  }
27442  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27443  ndim = ctx->head->field->type->ndim;
27444  while (*ts && *ts != ')') {
27445  switch (*ts) {
27446  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27447  default: break;
27448  }
27449  number = __Pyx_BufFmt_ExpectNumber(&ts);
27450  if (number == -1) return NULL;
27451  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27452  return PyErr_Format(PyExc_ValueError,
27453  "Expected a dimension of size %zu, got %d",
27454  ctx->head->field->type->arraysize[i], number);
27455  if (*ts != ',' && *ts != ')')
27456  return PyErr_Format(PyExc_ValueError,
27457  "Expected a comma in format string, got '%c'", *ts);
27458  if (*ts == ',') ts++;
27459  i++;
27460  }
27461  if (i != ndim)
27462  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27463  ctx->head->field->type->ndim, i);
27464  if (!*ts) {
27465  PyErr_SetString(PyExc_ValueError,
27466  "Unexpected end of format string, expected ')'");
27467  return NULL;
27468  }
27469  ctx->is_valid_array = 1;
27470  ctx->new_count = 1;
27471  *tsp = ++ts;
27472  return Py_None;
27473 }
27474 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27475  int got_Z = 0;
27476  while (1) {
27477  switch(*ts) {
27478  case 0:
27479  if (ctx->enc_type != 0 && ctx->head == NULL) {
27480  __Pyx_BufFmt_RaiseExpected(ctx);
27481  return NULL;
27482  }
27483  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27484  if (ctx->head != NULL) {
27485  __Pyx_BufFmt_RaiseExpected(ctx);
27486  return NULL;
27487  }
27488  return ts;
27489  case ' ':
27490  case '\r':
27491  case '\n':
27492  ++ts;
27493  break;
27494  case '<':
27495  if (!__Pyx_Is_Little_Endian()) {
27496  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27497  return NULL;
27498  }
27499  ctx->new_packmode = '=';
27500  ++ts;
27501  break;
27502  case '>':
27503  case '!':
27504  if (__Pyx_Is_Little_Endian()) {
27505  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27506  return NULL;
27507  }
27508  ctx->new_packmode = '=';
27509  ++ts;
27510  break;
27511  case '=':
27512  case '@':
27513  case '^':
27514  ctx->new_packmode = *ts++;
27515  break;
27516  case 'T':
27517  {
27518  const char* ts_after_sub;
27519  size_t i, struct_count = ctx->new_count;
27520  size_t struct_alignment = ctx->struct_alignment;
27521  ctx->new_count = 1;
27522  ++ts;
27523  if (*ts != '{') {
27524  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27525  return NULL;
27526  }
27527  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27528  ctx->enc_type = 0;
27529  ctx->enc_count = 0;
27530  ctx->struct_alignment = 0;
27531  ++ts;
27532  ts_after_sub = ts;
27533  for (i = 0; i != struct_count; ++i) {
27534  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27535  if (!ts_after_sub) return NULL;
27536  }
27537  ts = ts_after_sub;
27538  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27539  }
27540  break;
27541  case '}':
27542  {
27543  size_t alignment = ctx->struct_alignment;
27544  ++ts;
27545  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27546  ctx->enc_type = 0;
27547  if (alignment && ctx->fmt_offset % alignment) {
27548  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27549  }
27550  }
27551  return ts;
27552  case 'x':
27553  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27554  ctx->fmt_offset += ctx->new_count;
27555  ctx->new_count = 1;
27556  ctx->enc_count = 0;
27557  ctx->enc_type = 0;
27558  ctx->enc_packmode = ctx->new_packmode;
27559  ++ts;
27560  break;
27561  case 'Z':
27562  got_Z = 1;
27563  ++ts;
27564  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27565  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27566  return NULL;
27567  }
27568  CYTHON_FALLTHROUGH;
27569  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27570  case 'l': case 'L': case 'q': case 'Q':
27571  case 'f': case 'd': case 'g':
27572  case 'O': case 'p':
27573  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27574  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27575  ctx->enc_count += ctx->new_count;
27576  ctx->new_count = 1;
27577  got_Z = 0;
27578  ++ts;
27579  break;
27580  }
27581  CYTHON_FALLTHROUGH;
27582  case 's':
27583  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27584  ctx->enc_count = ctx->new_count;
27585  ctx->enc_packmode = ctx->new_packmode;
27586  ctx->enc_type = *ts;
27587  ctx->is_complex = got_Z;
27588  ++ts;
27589  ctx->new_count = 1;
27590  got_Z = 0;
27591  break;
27592  case ':':
27593  ++ts;
27594  while(*ts != ':') ++ts;
27595  ++ts;
27596  break;
27597  case '(':
27598  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27599  break;
27600  default:
27601  {
27602  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27603  if (number == -1) return NULL;
27604  ctx->new_count = (size_t)number;
27605  }
27606  }
27607  }
27608 }
27609 
27610 /* TypeInfoCompare */
27611  static int
27612 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27613 {
27614  int i;
27615  if (!a || !b)
27616  return 0;
27617  if (a == b)
27618  return 1;
27619  if (a->size != b->size || a->typegroup != b->typegroup ||
27620  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27621  if (a->typegroup == 'H' || b->typegroup == 'H') {
27622  return a->size == b->size;
27623  } else {
27624  return 0;
27625  }
27626  }
27627  if (a->ndim) {
27628  for (i = 0; i < a->ndim; i++)
27629  if (a->arraysize[i] != b->arraysize[i])
27630  return 0;
27631  }
27632  if (a->typegroup == 'S') {
27633  if (a->flags != b->flags)
27634  return 0;
27635  if (a->fields || b->fields) {
27636  if (!(a->fields && b->fields))
27637  return 0;
27638  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27639  __Pyx_StructField *field_a = a->fields + i;
27640  __Pyx_StructField *field_b = b->fields + i;
27641  if (field_a->offset != field_b->offset ||
27642  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27643  return 0;
27644  }
27645  return !a->fields[i].type && !b->fields[i].type;
27646  }
27647  }
27648  return 1;
27649 }
27650 
27651 /* MemviewSliceValidateAndInit */
27652  static int
27653 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27654 {
27655  if (buf->shape[dim] <= 1)
27656  return 1;
27657  if (buf->strides) {
27658  if (spec & __Pyx_MEMVIEW_CONTIG) {
27659  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27660  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27661  PyErr_Format(PyExc_ValueError,
27662  "Buffer is not indirectly contiguous "
27663  "in dimension %d.", dim);
27664  goto fail;
27665  }
27666  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27667  PyErr_SetString(PyExc_ValueError,
27668  "Buffer and memoryview are not contiguous "
27669  "in the same dimension.");
27670  goto fail;
27671  }
27672  }
27673  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27674  Py_ssize_t stride = buf->strides[dim];
27675  if (stride < 0)
27676  stride = -stride;
27677  if (unlikely(stride < buf->itemsize)) {
27678  PyErr_SetString(PyExc_ValueError,
27679  "Buffer and memoryview are not contiguous "
27680  "in the same dimension.");
27681  goto fail;
27682  }
27683  }
27684  } else {
27685  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27686  PyErr_Format(PyExc_ValueError,
27687  "C-contiguous buffer is not contiguous in "
27688  "dimension %d", dim);
27689  goto fail;
27690  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27691  PyErr_Format(PyExc_ValueError,
27692  "C-contiguous buffer is not indirect in "
27693  "dimension %d", dim);
27694  goto fail;
27695  } else if (unlikely(buf->suboffsets)) {
27696  PyErr_SetString(PyExc_ValueError,
27697  "Buffer exposes suboffsets but no strides");
27698  goto fail;
27699  }
27700  }
27701  return 1;
27702 fail:
27703  return 0;
27704 }
27705 static int
27706 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27707 {
27708  if (spec & __Pyx_MEMVIEW_DIRECT) {
27709  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27710  PyErr_Format(PyExc_ValueError,
27711  "Buffer not compatible with direct access "
27712  "in dimension %d.", dim);
27713  goto fail;
27714  }
27715  }
27716  if (spec & __Pyx_MEMVIEW_PTR) {
27717  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27718  PyErr_Format(PyExc_ValueError,
27719  "Buffer is not indirectly accessible "
27720  "in dimension %d.", dim);
27721  goto fail;
27722  }
27723  }
27724  return 1;
27725 fail:
27726  return 0;
27727 }
27728 static int
27729 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27730 {
27731  int i;
27732  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27733  Py_ssize_t stride = 1;
27734  for (i = 0; i < ndim; i++) {
27735  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27736  PyErr_SetString(PyExc_ValueError,
27737  "Buffer not fortran contiguous.");
27738  goto fail;
27739  }
27740  stride = stride * buf->shape[i];
27741  }
27742  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27743  Py_ssize_t stride = 1;
27744  for (i = ndim - 1; i >- 1; i--) {
27745  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27746  PyErr_SetString(PyExc_ValueError,
27747  "Buffer not C contiguous.");
27748  goto fail;
27749  }
27750  stride = stride * buf->shape[i];
27751  }
27752  }
27753  return 1;
27754 fail:
27755  return 0;
27756 }
27757 static int __Pyx_ValidateAndInit_memviewslice(
27758  int *axes_specs,
27759  int c_or_f_flag,
27760  int buf_flags,
27761  int ndim,
27762  __Pyx_TypeInfo *dtype,
27763  __Pyx_BufFmt_StackElem stack[],
27764  __Pyx_memviewslice *memviewslice,
27765  PyObject *original_obj)
27766 {
27767  struct __pyx_memoryview_obj *memview, *new_memview;
27768  __Pyx_RefNannyDeclarations
27769  Py_buffer *buf;
27770  int i, spec = 0, retval = -1;
27771  __Pyx_BufFmt_Context ctx;
27772  int from_memoryview = __pyx_memoryview_check(original_obj);
27773  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27774  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27775  original_obj)->typeinfo)) {
27776  memview = (struct __pyx_memoryview_obj *) original_obj;
27777  new_memview = NULL;
27778  } else {
27779  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27780  original_obj, buf_flags, 0, dtype);
27781  new_memview = memview;
27782  if (unlikely(!memview))
27783  goto fail;
27784  }
27785  buf = &memview->view;
27786  if (unlikely(buf->ndim != ndim)) {
27787  PyErr_Format(PyExc_ValueError,
27788  "Buffer has wrong number of dimensions (expected %d, got %d)",
27789  ndim, buf->ndim);
27790  goto fail;
27791  }
27792  if (new_memview) {
27793  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27794  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
27795  }
27796  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
27797  PyErr_Format(PyExc_ValueError,
27798  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27799  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27800  buf->itemsize,
27801  (buf->itemsize > 1) ? "s" : "",
27802  dtype->name,
27803  dtype->size,
27804  (dtype->size > 1) ? "s" : "");
27805  goto fail;
27806  }
27807  if (buf->len > 0) {
27808  for (i = 0; i < ndim; i++) {
27809  spec = axes_specs[i];
27810  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27811  goto fail;
27812  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27813  goto fail;
27814  }
27815  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27816  goto fail;
27817  }
27818  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27819  new_memview != NULL) == -1)) {
27820  goto fail;
27821  }
27822  retval = 0;
27823  goto no_fail;
27824 fail:
27825  Py_XDECREF(new_memview);
27826  retval = -1;
27827 no_fail:
27828  __Pyx_RefNannyFinishContext();
27829  return retval;
27830 }
27831 
27832 /* ObjectToMemviewSlice */
27833  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
27834  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27835  __Pyx_BufFmt_StackElem stack[1];
27836  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27837  int retcode;
27838  if (obj == Py_None) {
27839  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27840  return result;
27841  }
27842  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27843  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27844  &__Pyx_TypeInfo_float, stack,
27845  &result, obj);
27846  if (unlikely(retcode == -1))
27847  goto __pyx_fail;
27848  return result;
27849 __pyx_fail:
27850  result.memview = NULL;
27851  result.data = NULL;
27852  return result;
27853 }
27854 
27855 /* ObjectToMemviewSlice */
27856  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj, int writable_flag) {
27857  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27858  __Pyx_BufFmt_StackElem stack[1];
27859  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27860  int retcode;
27861  if (obj == Py_None) {
27862  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27863  return result;
27864  }
27865  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27866  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27867  &__Pyx_TypeInfo_float, stack,
27868  &result, obj);
27869  if (unlikely(retcode == -1))
27870  goto __pyx_fail;
27871  return result;
27872 __pyx_fail:
27873  result.memview = NULL;
27874  result.data = NULL;
27875  return result;
27876 }
27877 
27878 /* ObjectToMemviewSlice */
27879  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
27880  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27881  __Pyx_BufFmt_StackElem stack[1];
27882  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27883  int retcode;
27884  if (obj == Py_None) {
27885  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27886  return result;
27887  }
27888  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27889  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27890  &__Pyx_TypeInfo_double, stack,
27891  &result, obj);
27892  if (unlikely(retcode == -1))
27893  goto __pyx_fail;
27894  return result;
27895 __pyx_fail:
27896  result.memview = NULL;
27897  result.data = NULL;
27898  return result;
27899 }
27900 
27901 /* ObjectToMemviewSlice */
27902  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
27903  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27904  __Pyx_BufFmt_StackElem stack[1];
27905  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27906  int retcode;
27907  if (obj == Py_None) {
27908  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27909  return result;
27910  }
27911  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27912  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27913  &__Pyx_TypeInfo_double, stack,
27914  &result, obj);
27915  if (unlikely(retcode == -1))
27916  goto __pyx_fail;
27917  return result;
27918 __pyx_fail:
27919  result.memview = NULL;
27920  result.data = NULL;
27921  return result;
27922 }
27923 
27924 /* ObjectToMemviewSlice */
27925  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
27926  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27927  __Pyx_BufFmt_StackElem stack[1];
27928  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27929  int retcode;
27930  if (obj == Py_None) {
27931  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27932  return result;
27933  }
27934  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27935  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27936  &__Pyx_TypeInfo_long__double, stack,
27937  &result, obj);
27938  if (unlikely(retcode == -1))
27939  goto __pyx_fail;
27940  return result;
27941 __pyx_fail:
27942  result.memview = NULL;
27943  result.data = NULL;
27944  return result;
27945 }
27946 
27947 /* ObjectToMemviewSlice */
27948  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj, int writable_flag) {
27949  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27950  __Pyx_BufFmt_StackElem stack[1];
27951  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27952  int retcode;
27953  if (obj == Py_None) {
27954  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27955  return result;
27956  }
27957  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27958  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27959  &__Pyx_TypeInfo_long__double, stack,
27960  &result, obj);
27961  if (unlikely(retcode == -1))
27962  goto __pyx_fail;
27963  return result;
27964 __pyx_fail:
27965  result.memview = NULL;
27966  result.data = NULL;
27967  return result;
27968 }
27969 
27970 /* ObjectToMemviewSlice */
27971  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
27972  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27973  __Pyx_BufFmt_StackElem stack[1];
27974  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27975  int retcode;
27976  if (obj == Py_None) {
27977  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27978  return result;
27979  }
27980  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27981  PyBUF_RECORDS_RO | writable_flag, 1,
27982  &__Pyx_TypeInfo_int, stack,
27983  &result, obj);
27984  if (unlikely(retcode == -1))
27985  goto __pyx_fail;
27986  return result;
27987 __pyx_fail:
27988  result.memview = NULL;
27989  result.data = NULL;
27990  return result;
27991 }
27992 
27993 /* ObjectToMemviewSlice */
27994  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
27995  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27996  __Pyx_BufFmt_StackElem stack[1];
27997  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27998  int retcode;
27999  if (obj == Py_None) {
28000  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28001  return result;
28002  }
28003  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28004  PyBUF_RECORDS_RO | writable_flag, 1,
28005  &__Pyx_TypeInfo_float, stack,
28006  &result, obj);
28007  if (unlikely(retcode == -1))
28008  goto __pyx_fail;
28009  return result;
28010 __pyx_fail:
28011  result.memview = NULL;
28012  result.data = NULL;
28013  return result;
28014 }
28015 
28016 /* ObjectToMemviewSlice */
28017  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
28018  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28019  __Pyx_BufFmt_StackElem stack[1];
28020  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28021  int retcode;
28022  if (obj == Py_None) {
28023  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28024  return result;
28025  }
28026  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28027  PyBUF_RECORDS_RO | writable_flag, 1,
28028  &__Pyx_TypeInfo_double, stack,
28029  &result, obj);
28030  if (unlikely(retcode == -1))
28031  goto __pyx_fail;
28032  return result;
28033 __pyx_fail:
28034  result.memview = NULL;
28035  result.data = NULL;
28036  return result;
28037 }
28038 
28039 /* ObjectToMemviewSlice */
28040  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
28041  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28042  __Pyx_BufFmt_StackElem stack[1];
28043  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28044  int retcode;
28045  if (obj == Py_None) {
28046  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28047  return result;
28048  }
28049  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28050  PyBUF_RECORDS_RO | writable_flag, 1,
28051  &__Pyx_TypeInfo_long__double, stack,
28052  &result, obj);
28053  if (unlikely(retcode == -1))
28054  goto __pyx_fail;
28055  return result;
28056 __pyx_fail:
28057  result.memview = NULL;
28058  result.data = NULL;
28059  return result;
28060 }
28061 
28062 /* MemviewSliceCopyTemplate */
28063  static __Pyx_memviewslice
28064 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
28065  const char *mode, int ndim,
28066  size_t sizeof_dtype, int contig_flag,
28067  int dtype_is_object)
28068 {
28069  __Pyx_RefNannyDeclarations
28070  int i;
28071  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28072  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28073  Py_buffer *buf = &from_memview->view;
28074  PyObject *shape_tuple = NULL;
28075  PyObject *temp_int = NULL;
28076  struct __pyx_array_obj *array_obj = NULL;
28077  struct __pyx_memoryview_obj *memview_obj = NULL;
28078  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
28079  for (i = 0; i < ndim; i++) {
28080  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28081  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
28082  "indirect dimensions (axis %d)", i);
28083  goto fail;
28084  }
28085  }
28086  shape_tuple = PyTuple_New(ndim);
28087  if (unlikely(!shape_tuple)) {
28088  goto fail;
28089  }
28090  __Pyx_GOTREF(shape_tuple);
28091  for(i = 0; i < ndim; i++) {
28092  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28093  if(unlikely(!temp_int)) {
28094  goto fail;
28095  } else {
28096  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28097  temp_int = NULL;
28098  }
28099  }
28100  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28101  if (unlikely(!array_obj)) {
28102  goto fail;
28103  }
28104  __Pyx_GOTREF(array_obj);
28105  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28106  (PyObject *) array_obj, contig_flag,
28107  dtype_is_object,
28108  from_mvs->memview->typeinfo);
28109  if (unlikely(!memview_obj))
28110  goto fail;
28111  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28112  goto fail;
28113  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28114  dtype_is_object) < 0))
28115  goto fail;
28116  goto no_fail;
28117 fail:
28118  __Pyx_XDECREF(new_mvs.memview);
28119  new_mvs.memview = NULL;
28120  new_mvs.data = NULL;
28121 no_fail:
28122  __Pyx_XDECREF(shape_tuple);
28123  __Pyx_XDECREF(temp_int);
28124  __Pyx_XDECREF(array_obj);
28125  __Pyx_RefNannyFinishContext();
28126  return new_mvs;
28127 }
28128 
28129 /* CIntToPy */
28130  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28131 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28132 #pragma GCC diagnostic push
28133 #pragma GCC diagnostic ignored "-Wconversion"
28134 #endif
28135  const long neg_one = (long) -1, const_zero = (long) 0;
28136 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28137 #pragma GCC diagnostic pop
28138 #endif
28139  const int is_unsigned = neg_one > const_zero;
28140  if (is_unsigned) {
28141  if (sizeof(long) < sizeof(long)) {
28142  return PyInt_FromLong((long) value);
28143  } else if (sizeof(long) <= sizeof(unsigned long)) {
28144  return PyLong_FromUnsignedLong((unsigned long) value);
28145 #ifdef HAVE_LONG_LONG
28146  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28147  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28148 #endif
28149  }
28150  } else {
28151  if (sizeof(long) <= sizeof(long)) {
28152  return PyInt_FromLong((long) value);
28153 #ifdef HAVE_LONG_LONG
28154  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28155  return PyLong_FromLongLong((PY_LONG_LONG) value);
28156 #endif
28157  }
28158  }
28159  {
28160  int one = 1; int little = (int)*(unsigned char *)&one;
28161  unsigned char *bytes = (unsigned char *)&value;
28162  return _PyLong_FromByteArray(bytes, sizeof(long),
28163  little, !is_unsigned);
28164  }
28165 }
28166 
28167 /* CIntFromPy */
28168  static CYTHON_INLINE LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *x) {
28169 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28170 #pragma GCC diagnostic push
28171 #pragma GCC diagnostic ignored "-Wconversion"
28172 #endif
28173  const LongIndexType neg_one = (LongIndexType) -1, const_zero = (LongIndexType) 0;
28174 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28175 #pragma GCC diagnostic pop
28176 #endif
28177  const int is_unsigned = neg_one > const_zero;
28178 #if PY_MAJOR_VERSION < 3
28179  if (likely(PyInt_Check(x))) {
28180  if (sizeof(LongIndexType) < sizeof(long)) {
28181  __PYX_VERIFY_RETURN_INT(LongIndexType, long, PyInt_AS_LONG(x))
28182  } else {
28183  long val = PyInt_AS_LONG(x);
28184  if (is_unsigned && unlikely(val < 0)) {
28185  goto raise_neg_overflow;
28186  }
28187  return (LongIndexType) val;
28188  }
28189  } else
28190 #endif
28191  if (likely(PyLong_Check(x))) {
28192  if (is_unsigned) {
28193 #if CYTHON_USE_PYLONG_INTERNALS
28194  const digit* digits = ((PyLongObject*)x)->ob_digit;
28195  switch (Py_SIZE(x)) {
28196  case 0: return (LongIndexType) 0;
28197  case 1: __PYX_VERIFY_RETURN_INT(LongIndexType, digit, digits[0])
28198  case 2:
28199  if (8 * sizeof(LongIndexType) > 1 * PyLong_SHIFT) {
28200  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28201  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28202  } else if (8 * sizeof(LongIndexType) >= 2 * PyLong_SHIFT) {
28203  return (LongIndexType) (((((LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0]));
28204  }
28205  }
28206  break;
28207  case 3:
28208  if (8 * sizeof(LongIndexType) > 2 * PyLong_SHIFT) {
28209  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28210  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28211  } else if (8 * sizeof(LongIndexType) >= 3 * PyLong_SHIFT) {
28212  return (LongIndexType) (((((((LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0]));
28213  }
28214  }
28215  break;
28216  case 4:
28217  if (8 * sizeof(LongIndexType) > 3 * PyLong_SHIFT) {
28218  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28219  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28220  } else if (8 * sizeof(LongIndexType) >= 4 * PyLong_SHIFT) {
28221  return (LongIndexType) (((((((((LongIndexType)digits[3]) << PyLong_SHIFT) | (LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0]));
28222  }
28223  }
28224  break;
28225  }
28226 #endif
28227 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28228  if (unlikely(Py_SIZE(x) < 0)) {
28229  goto raise_neg_overflow;
28230  }
28231 #else
28232  {
28233  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28234  if (unlikely(result < 0))
28235  return (LongIndexType) -1;
28236  if (unlikely(result == 1))
28237  goto raise_neg_overflow;
28238  }
28239 #endif
28240  if (sizeof(LongIndexType) <= sizeof(unsigned long)) {
28241  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, unsigned long, PyLong_AsUnsignedLong(x))
28242 #ifdef HAVE_LONG_LONG
28243  } else if (sizeof(LongIndexType) <= sizeof(unsigned PY_LONG_LONG)) {
28244  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28245 #endif
28246  }
28247  } else {
28248 #if CYTHON_USE_PYLONG_INTERNALS
28249  const digit* digits = ((PyLongObject*)x)->ob_digit;
28250  switch (Py_SIZE(x)) {
28251  case 0: return (LongIndexType) 0;
28252  case -1: __PYX_VERIFY_RETURN_INT(LongIndexType, sdigit, (sdigit) (-(sdigit)digits[0]))
28253  case 1: __PYX_VERIFY_RETURN_INT(LongIndexType, digit, +digits[0])
28254  case -2:
28255  if (8 * sizeof(LongIndexType) - 1 > 1 * PyLong_SHIFT) {
28256  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28257  __PYX_VERIFY_RETURN_INT(LongIndexType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28258  } else if (8 * sizeof(LongIndexType) - 1 > 2 * PyLong_SHIFT) {
28259  return (LongIndexType) (((LongIndexType)-1)*(((((LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
28260  }
28261  }
28262  break;
28263  case 2:
28264  if (8 * sizeof(LongIndexType) > 1 * PyLong_SHIFT) {
28265  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28266  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28267  } else if (8 * sizeof(LongIndexType) - 1 > 2 * PyLong_SHIFT) {
28268  return (LongIndexType) ((((((LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
28269  }
28270  }
28271  break;
28272  case -3:
28273  if (8 * sizeof(LongIndexType) - 1 > 2 * PyLong_SHIFT) {
28274  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28275  __PYX_VERIFY_RETURN_INT(LongIndexType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28276  } else if (8 * sizeof(LongIndexType) - 1 > 3 * PyLong_SHIFT) {
28277  return (LongIndexType) (((LongIndexType)-1)*(((((((LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
28278  }
28279  }
28280  break;
28281  case 3:
28282  if (8 * sizeof(LongIndexType) > 2 * PyLong_SHIFT) {
28283  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28284  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28285  } else if (8 * sizeof(LongIndexType) - 1 > 3 * PyLong_SHIFT) {
28286  return (LongIndexType) ((((((((LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
28287  }
28288  }
28289  break;
28290  case -4:
28291  if (8 * sizeof(LongIndexType) - 1 > 3 * PyLong_SHIFT) {
28292  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28293  __PYX_VERIFY_RETURN_INT(LongIndexType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28294  } else if (8 * sizeof(LongIndexType) - 1 > 4 * PyLong_SHIFT) {
28295  return (LongIndexType) (((LongIndexType)-1)*(((((((((LongIndexType)digits[3]) << PyLong_SHIFT) | (LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
28296  }
28297  }
28298  break;
28299  case 4:
28300  if (8 * sizeof(LongIndexType) > 3 * PyLong_SHIFT) {
28301  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28302  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28303  } else if (8 * sizeof(LongIndexType) - 1 > 4 * PyLong_SHIFT) {
28304  return (LongIndexType) ((((((((((LongIndexType)digits[3]) << PyLong_SHIFT) | (LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
28305  }
28306  }
28307  break;
28308  }
28309 #endif
28310  if (sizeof(LongIndexType) <= sizeof(long)) {
28311  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, long, PyLong_AsLong(x))
28312 #ifdef HAVE_LONG_LONG
28313  } else if (sizeof(LongIndexType) <= sizeof(PY_LONG_LONG)) {
28314  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, PY_LONG_LONG, PyLong_AsLongLong(x))
28315 #endif
28316  }
28317  }
28318  {
28319 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28320  PyErr_SetString(PyExc_RuntimeError,
28321  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28322 #else
28323  LongIndexType val;
28324  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28325  #if PY_MAJOR_VERSION < 3
28326  if (likely(v) && !PyLong_Check(v)) {
28327  PyObject *tmp = v;
28328  v = PyNumber_Long(tmp);
28329  Py_DECREF(tmp);
28330  }
28331  #endif
28332  if (likely(v)) {
28333  int one = 1; int is_little = (int)*(unsigned char *)&one;
28334  unsigned char *bytes = (unsigned char *)&val;
28335  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28336  bytes, sizeof(val),
28337  is_little, !is_unsigned);
28338  Py_DECREF(v);
28339  if (likely(!ret))
28340  return val;
28341  }
28342 #endif
28343  return (LongIndexType) -1;
28344  }
28345  } else {
28346  LongIndexType val;
28347  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28348  if (!tmp) return (LongIndexType) -1;
28349  val = __Pyx_PyInt_As_LongIndexType(tmp);
28350  Py_DECREF(tmp);
28351  return val;
28352  }
28353 raise_overflow:
28354  PyErr_SetString(PyExc_OverflowError,
28355  "value too large to convert to LongIndexType");
28356  return (LongIndexType) -1;
28357 raise_neg_overflow:
28358  PyErr_SetString(PyExc_OverflowError,
28359  "can't convert negative value to LongIndexType");
28360  return (LongIndexType) -1;
28361 }
28362 
28363 /* CIntFromPy */
28364  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28365 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28366 #pragma GCC diagnostic push
28367 #pragma GCC diagnostic ignored "-Wconversion"
28368 #endif
28369  const int neg_one = (int) -1, const_zero = (int) 0;
28370 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28371 #pragma GCC diagnostic pop
28372 #endif
28373  const int is_unsigned = neg_one > const_zero;
28374 #if PY_MAJOR_VERSION < 3
28375  if (likely(PyInt_Check(x))) {
28376  if (sizeof(int) < sizeof(long)) {
28377  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28378  } else {
28379  long val = PyInt_AS_LONG(x);
28380  if (is_unsigned && unlikely(val < 0)) {
28381  goto raise_neg_overflow;
28382  }
28383  return (int) val;
28384  }
28385  } else
28386 #endif
28387  if (likely(PyLong_Check(x))) {
28388  if (is_unsigned) {
28389 #if CYTHON_USE_PYLONG_INTERNALS
28390  const digit* digits = ((PyLongObject*)x)->ob_digit;
28391  switch (Py_SIZE(x)) {
28392  case 0: return (int) 0;
28393  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28394  case 2:
28395  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28396  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28397  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28398  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28399  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28400  }
28401  }
28402  break;
28403  case 3:
28404  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28405  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28406  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28407  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28408  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28409  }
28410  }
28411  break;
28412  case 4:
28413  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28414  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28415  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28416  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28417  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28418  }
28419  }
28420  break;
28421  }
28422 #endif
28423 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28424  if (unlikely(Py_SIZE(x) < 0)) {
28425  goto raise_neg_overflow;
28426  }
28427 #else
28428  {
28429  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28430  if (unlikely(result < 0))
28431  return (int) -1;
28432  if (unlikely(result == 1))
28433  goto raise_neg_overflow;
28434  }
28435 #endif
28436  if (sizeof(int) <= sizeof(unsigned long)) {
28437  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28438 #ifdef HAVE_LONG_LONG
28439  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28440  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28441 #endif
28442  }
28443  } else {
28444 #if CYTHON_USE_PYLONG_INTERNALS
28445  const digit* digits = ((PyLongObject*)x)->ob_digit;
28446  switch (Py_SIZE(x)) {
28447  case 0: return (int) 0;
28448  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28449  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28450  case -2:
28451  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28452  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28453  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28454  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28455  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28456  }
28457  }
28458  break;
28459  case 2:
28460  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28461  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28462  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28463  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28464  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28465  }
28466  }
28467  break;
28468  case -3:
28469  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28470  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28471  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28472  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28473  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28474  }
28475  }
28476  break;
28477  case 3:
28478  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28479  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28480  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28481  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28482  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28483  }
28484  }
28485  break;
28486  case -4:
28487  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28488  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28489  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28490  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28491  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28492  }
28493  }
28494  break;
28495  case 4:
28496  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28497  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28498  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28499  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28500  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28501  }
28502  }
28503  break;
28504  }
28505 #endif
28506  if (sizeof(int) <= sizeof(long)) {
28507  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28508 #ifdef HAVE_LONG_LONG
28509  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28510  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28511 #endif
28512  }
28513  }
28514  {
28515 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28516  PyErr_SetString(PyExc_RuntimeError,
28517  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28518 #else
28519  int val;
28520  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28521  #if PY_MAJOR_VERSION < 3
28522  if (likely(v) && !PyLong_Check(v)) {
28523  PyObject *tmp = v;
28524  v = PyNumber_Long(tmp);
28525  Py_DECREF(tmp);
28526  }
28527  #endif
28528  if (likely(v)) {
28529  int one = 1; int is_little = (int)*(unsigned char *)&one;
28530  unsigned char *bytes = (unsigned char *)&val;
28531  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28532  bytes, sizeof(val),
28533  is_little, !is_unsigned);
28534  Py_DECREF(v);
28535  if (likely(!ret))
28536  return val;
28537  }
28538 #endif
28539  return (int) -1;
28540  }
28541  } else {
28542  int val;
28543  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28544  if (!tmp) return (int) -1;
28545  val = __Pyx_PyInt_As_int(tmp);
28546  Py_DECREF(tmp);
28547  return val;
28548  }
28549 raise_overflow:
28550  PyErr_SetString(PyExc_OverflowError,
28551  "value too large to convert to int");
28552  return (int) -1;
28553 raise_neg_overflow:
28554  PyErr_SetString(PyExc_OverflowError,
28555  "can't convert negative value to int");
28556  return (int) -1;
28557 }
28558 
28559 /* CIntFromPy */
28560  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28561 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28562 #pragma GCC diagnostic push
28563 #pragma GCC diagnostic ignored "-Wconversion"
28564 #endif
28565  const long neg_one = (long) -1, const_zero = (long) 0;
28566 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28567 #pragma GCC diagnostic pop
28568 #endif
28569  const int is_unsigned = neg_one > const_zero;
28570 #if PY_MAJOR_VERSION < 3
28571  if (likely(PyInt_Check(x))) {
28572  if (sizeof(long) < sizeof(long)) {
28573  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28574  } else {
28575  long val = PyInt_AS_LONG(x);
28576  if (is_unsigned && unlikely(val < 0)) {
28577  goto raise_neg_overflow;
28578  }
28579  return (long) val;
28580  }
28581  } else
28582 #endif
28583  if (likely(PyLong_Check(x))) {
28584  if (is_unsigned) {
28585 #if CYTHON_USE_PYLONG_INTERNALS
28586  const digit* digits = ((PyLongObject*)x)->ob_digit;
28587  switch (Py_SIZE(x)) {
28588  case 0: return (long) 0;
28589  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28590  case 2:
28591  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28592  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28593  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28594  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28595  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28596  }
28597  }
28598  break;
28599  case 3:
28600  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28601  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28602  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28603  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28604  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28605  }
28606  }
28607  break;
28608  case 4:
28609  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28610  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28611  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28612  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28613  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28614  }
28615  }
28616  break;
28617  }
28618 #endif
28619 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28620  if (unlikely(Py_SIZE(x) < 0)) {
28621  goto raise_neg_overflow;
28622  }
28623 #else
28624  {
28625  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28626  if (unlikely(result < 0))
28627  return (long) -1;
28628  if (unlikely(result == 1))
28629  goto raise_neg_overflow;
28630  }
28631 #endif
28632  if (sizeof(long) <= sizeof(unsigned long)) {
28633  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28634 #ifdef HAVE_LONG_LONG
28635  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28636  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28637 #endif
28638  }
28639  } else {
28640 #if CYTHON_USE_PYLONG_INTERNALS
28641  const digit* digits = ((PyLongObject*)x)->ob_digit;
28642  switch (Py_SIZE(x)) {
28643  case 0: return (long) 0;
28644  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28645  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28646  case -2:
28647  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28648  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28649  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28650  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28651  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28652  }
28653  }
28654  break;
28655  case 2:
28656  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28657  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28658  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28659  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28660  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28661  }
28662  }
28663  break;
28664  case -3:
28665  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28666  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28667  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28668  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28669  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28670  }
28671  }
28672  break;
28673  case 3:
28674  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28675  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28676  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28677  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28678  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28679  }
28680  }
28681  break;
28682  case -4:
28683  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28684  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28685  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28686  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28687  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28688  }
28689  }
28690  break;
28691  case 4:
28692  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28693  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28694  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28695  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28696  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28697  }
28698  }
28699  break;
28700  }
28701 #endif
28702  if (sizeof(long) <= sizeof(long)) {
28703  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28704 #ifdef HAVE_LONG_LONG
28705  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28706  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28707 #endif
28708  }
28709  }
28710  {
28711 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28712  PyErr_SetString(PyExc_RuntimeError,
28713  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28714 #else
28715  long val;
28716  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28717  #if PY_MAJOR_VERSION < 3
28718  if (likely(v) && !PyLong_Check(v)) {
28719  PyObject *tmp = v;
28720  v = PyNumber_Long(tmp);
28721  Py_DECREF(tmp);
28722  }
28723  #endif
28724  if (likely(v)) {
28725  int one = 1; int is_little = (int)*(unsigned char *)&one;
28726  unsigned char *bytes = (unsigned char *)&val;
28727  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28728  bytes, sizeof(val),
28729  is_little, !is_unsigned);
28730  Py_DECREF(v);
28731  if (likely(!ret))
28732  return val;
28733  }
28734 #endif
28735  return (long) -1;
28736  }
28737  } else {
28738  long val;
28739  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28740  if (!tmp) return (long) -1;
28741  val = __Pyx_PyInt_As_long(tmp);
28742  Py_DECREF(tmp);
28743  return val;
28744  }
28745 raise_overflow:
28746  PyErr_SetString(PyExc_OverflowError,
28747  "value too large to convert to long");
28748  return (long) -1;
28749 raise_neg_overflow:
28750  PyErr_SetString(PyExc_OverflowError,
28751  "can't convert negative value to long");
28752  return (long) -1;
28753 }
28754 
28755 /* CIntToPy */
28756  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28757 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28758 #pragma GCC diagnostic push
28759 #pragma GCC diagnostic ignored "-Wconversion"
28760 #endif
28761  const int neg_one = (int) -1, const_zero = (int) 0;
28762 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28763 #pragma GCC diagnostic pop
28764 #endif
28765  const int is_unsigned = neg_one > const_zero;
28766  if (is_unsigned) {
28767  if (sizeof(int) < sizeof(long)) {
28768  return PyInt_FromLong((long) value);
28769  } else if (sizeof(int) <= sizeof(unsigned long)) {
28770  return PyLong_FromUnsignedLong((unsigned long) value);
28771 #ifdef HAVE_LONG_LONG
28772  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28773  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28774 #endif
28775  }
28776  } else {
28777  if (sizeof(int) <= sizeof(long)) {
28778  return PyInt_FromLong((long) value);
28779 #ifdef HAVE_LONG_LONG
28780  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28781  return PyLong_FromLongLong((PY_LONG_LONG) value);
28782 #endif
28783  }
28784  }
28785  {
28786  int one = 1; int little = (int)*(unsigned char *)&one;
28787  unsigned char *bytes = (unsigned char *)&value;
28788  return _PyLong_FromByteArray(bytes, sizeof(int),
28789  little, !is_unsigned);
28790  }
28791 }
28792 
28793 /* CIntFromPy */
28794  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28795 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28796 #pragma GCC diagnostic push
28797 #pragma GCC diagnostic ignored "-Wconversion"
28798 #endif
28799  const char neg_one = (char) -1, const_zero = (char) 0;
28800 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28801 #pragma GCC diagnostic pop
28802 #endif
28803  const int is_unsigned = neg_one > const_zero;
28804 #if PY_MAJOR_VERSION < 3
28805  if (likely(PyInt_Check(x))) {
28806  if (sizeof(char) < sizeof(long)) {
28807  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28808  } else {
28809  long val = PyInt_AS_LONG(x);
28810  if (is_unsigned && unlikely(val < 0)) {
28811  goto raise_neg_overflow;
28812  }
28813  return (char) val;
28814  }
28815  } else
28816 #endif
28817  if (likely(PyLong_Check(x))) {
28818  if (is_unsigned) {
28819 #if CYTHON_USE_PYLONG_INTERNALS
28820  const digit* digits = ((PyLongObject*)x)->ob_digit;
28821  switch (Py_SIZE(x)) {
28822  case 0: return (char) 0;
28823  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28824  case 2:
28825  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28826  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28827  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28828  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28829  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28830  }
28831  }
28832  break;
28833  case 3:
28834  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28835  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28836  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28837  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28838  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28839  }
28840  }
28841  break;
28842  case 4:
28843  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28844  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28845  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28846  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28847  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28848  }
28849  }
28850  break;
28851  }
28852 #endif
28853 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28854  if (unlikely(Py_SIZE(x) < 0)) {
28855  goto raise_neg_overflow;
28856  }
28857 #else
28858  {
28859  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28860  if (unlikely(result < 0))
28861  return (char) -1;
28862  if (unlikely(result == 1))
28863  goto raise_neg_overflow;
28864  }
28865 #endif
28866  if (sizeof(char) <= sizeof(unsigned long)) {
28867  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28868 #ifdef HAVE_LONG_LONG
28869  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28870  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28871 #endif
28872  }
28873  } else {
28874 #if CYTHON_USE_PYLONG_INTERNALS
28875  const digit* digits = ((PyLongObject*)x)->ob_digit;
28876  switch (Py_SIZE(x)) {
28877  case 0: return (char) 0;
28878  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28879  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28880  case -2:
28881  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28882  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28883  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28884  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28885  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28886  }
28887  }
28888  break;
28889  case 2:
28890  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28891  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28892  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28893  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28894  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28895  }
28896  }
28897  break;
28898  case -3:
28899  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28900  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28901  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28902  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28903  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28904  }
28905  }
28906  break;
28907  case 3:
28908  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28909  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28910  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28911  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28912  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28913  }
28914  }
28915  break;
28916  case -4:
28917  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28918  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28919  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28920  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28921  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28922  }
28923  }
28924  break;
28925  case 4:
28926  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28927  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28928  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28929  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28930  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28931  }
28932  }
28933  break;
28934  }
28935 #endif
28936  if (sizeof(char) <= sizeof(long)) {
28937  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28938 #ifdef HAVE_LONG_LONG
28939  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28940  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28941 #endif
28942  }
28943  }
28944  {
28945 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28946  PyErr_SetString(PyExc_RuntimeError,
28947  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28948 #else
28949  char val;
28950  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28951  #if PY_MAJOR_VERSION < 3
28952  if (likely(v) && !PyLong_Check(v)) {
28953  PyObject *tmp = v;
28954  v = PyNumber_Long(tmp);
28955  Py_DECREF(tmp);
28956  }
28957  #endif
28958  if (likely(v)) {
28959  int one = 1; int is_little = (int)*(unsigned char *)&one;
28960  unsigned char *bytes = (unsigned char *)&val;
28961  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28962  bytes, sizeof(val),
28963  is_little, !is_unsigned);
28964  Py_DECREF(v);
28965  if (likely(!ret))
28966  return val;
28967  }
28968 #endif
28969  return (char) -1;
28970  }
28971  } else {
28972  char val;
28973  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28974  if (!tmp) return (char) -1;
28975  val = __Pyx_PyInt_As_char(tmp);
28976  Py_DECREF(tmp);
28977  return val;
28978  }
28979 raise_overflow:
28980  PyErr_SetString(PyExc_OverflowError,
28981  "value too large to convert to char");
28982  return (char) -1;
28983 raise_neg_overflow:
28984  PyErr_SetString(PyExc_OverflowError,
28985  "can't convert negative value to char");
28986  return (char) -1;
28987 }
28988 
28989 /* CheckBinaryVersion */
28990  static int __Pyx_check_binary_version(void) {
28991  char ctversion[5];
28992  int same=1, i, found_dot;
28993  const char* rt_from_call = Py_GetVersion();
28994  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28995  found_dot = 0;
28996  for (i = 0; i < 4; i++) {
28997  if (!ctversion[i]) {
28998  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
28999  break;
29000  }
29001  if (rt_from_call[i] != ctversion[i]) {
29002  same = 0;
29003  break;
29004  }
29005  }
29006  if (!same) {
29007  char rtversion[5] = {'\0'};
29008  char message[200];
29009  for (i=0; i<4; ++i) {
29010  if (rt_from_call[i] == '.') {
29011  if (found_dot) break;
29012  found_dot = 1;
29013  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
29014  break;
29015  }
29016  rtversion[i] = rt_from_call[i];
29017  }
29018  PyOS_snprintf(message, sizeof(message),
29019  "compiletime version %s of module '%.100s' "
29020  "does not match runtime version %s",
29021  ctversion, __Pyx_MODULE_NAME, rtversion);
29022  return PyErr_WarnEx(NULL, message, 1);
29023  }
29024  return 0;
29025 }
29026 
29027 /* InitStrings */
29028  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29029  while (t->p) {
29030  #if PY_MAJOR_VERSION < 3
29031  if (t->is_unicode) {
29032  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29033  } else if (t->intern) {
29034  *t->p = PyString_InternFromString(t->s);
29035  } else {
29036  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29037  }
29038  #else
29039  if (t->is_unicode | t->is_str) {
29040  if (t->intern) {
29041  *t->p = PyUnicode_InternFromString(t->s);
29042  } else if (t->encoding) {
29043  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29044  } else {
29045  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29046  }
29047  } else {
29048  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29049  }
29050  #endif
29051  if (!*t->p)
29052  return -1;
29053  if (PyObject_Hash(*t->p) == -1)
29054  return -1;
29055  ++t;
29056  }
29057  return 0;
29058 }
29059 
29060 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29061  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29062 }
29063 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29064  Py_ssize_t ignore;
29065  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29066 }
29067 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29068 #if !CYTHON_PEP393_ENABLED
29069 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29070  char* defenc_c;
29071  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29072  if (!defenc) return NULL;
29073  defenc_c = PyBytes_AS_STRING(defenc);
29074 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29075  {
29076  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29077  char* c;
29078  for (c = defenc_c; c < end; c++) {
29079  if ((unsigned char) (*c) >= 128) {
29080  PyUnicode_AsASCIIString(o);
29081  return NULL;
29082  }
29083  }
29084  }
29085 #endif
29086  *length = PyBytes_GET_SIZE(defenc);
29087  return defenc_c;
29088 }
29089 #else
29090 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29091  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29092 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29093  if (likely(PyUnicode_IS_ASCII(o))) {
29094  *length = PyUnicode_GET_LENGTH(o);
29095  return PyUnicode_AsUTF8(o);
29096  } else {
29097  PyUnicode_AsASCIIString(o);
29098  return NULL;
29099  }
29100 #else
29101  return PyUnicode_AsUTF8AndSize(o, length);
29102 #endif
29103 }
29104 #endif
29105 #endif
29106 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29107 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29108  if (
29109 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29110  __Pyx_sys_getdefaultencoding_not_ascii &&
29111 #endif
29112  PyUnicode_Check(o)) {
29113  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29114  } else
29115 #endif
29116 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29117  if (PyByteArray_Check(o)) {
29118  *length = PyByteArray_GET_SIZE(o);
29119  return PyByteArray_AS_STRING(o);
29120  } else
29121 #endif
29122  {
29123  char* result;
29124  int r = PyBytes_AsStringAndSize(o, &result, length);
29125  if (unlikely(r < 0)) {
29126  return NULL;
29127  } else {
29128  return result;
29129  }
29130  }
29131 }
29132 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29133  int is_true = x == Py_True;
29134  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29135  else return PyObject_IsTrue(x);
29136 }
29137 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29138  int retval;
29139  if (unlikely(!x)) return -1;
29140  retval = __Pyx_PyObject_IsTrue(x);
29141  Py_DECREF(x);
29142  return retval;
29143 }
29144 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29145 #if PY_MAJOR_VERSION >= 3
29146  if (PyLong_Check(result)) {
29147  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29148  "__int__ returned non-int (type %.200s). "
29149  "The ability to return an instance of a strict subclass of int "
29150  "is deprecated, and may be removed in a future version of Python.",
29151  Py_TYPE(result)->tp_name)) {
29152  Py_DECREF(result);
29153  return NULL;
29154  }
29155  return result;
29156  }
29157 #endif
29158  PyErr_Format(PyExc_TypeError,
29159  "__%.4s__ returned non-%.4s (type %.200s)",
29160  type_name, type_name, Py_TYPE(result)->tp_name);
29161  Py_DECREF(result);
29162  return NULL;
29163 }
29164 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29165 #if CYTHON_USE_TYPE_SLOTS
29166  PyNumberMethods *m;
29167 #endif
29168  const char *name = NULL;
29169  PyObject *res = NULL;
29170 #if PY_MAJOR_VERSION < 3
29171  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29172 #else
29173  if (likely(PyLong_Check(x)))
29174 #endif
29175  return __Pyx_NewRef(x);
29176 #if CYTHON_USE_TYPE_SLOTS
29177  m = Py_TYPE(x)->tp_as_number;
29178  #if PY_MAJOR_VERSION < 3
29179  if (m && m->nb_int) {
29180  name = "int";
29181  res = m->nb_int(x);
29182  }
29183  else if (m && m->nb_long) {
29184  name = "long";
29185  res = m->nb_long(x);
29186  }
29187  #else
29188  if (likely(m && m->nb_int)) {
29189  name = "int";
29190  res = m->nb_int(x);
29191  }
29192  #endif
29193 #else
29194  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29195  res = PyNumber_Int(x);
29196  }
29197 #endif
29198  if (likely(res)) {
29199 #if PY_MAJOR_VERSION < 3
29200  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29201 #else
29202  if (unlikely(!PyLong_CheckExact(res))) {
29203 #endif
29204  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29205  }
29206  }
29207  else if (!PyErr_Occurred()) {
29208  PyErr_SetString(PyExc_TypeError,
29209  "an integer is required");
29210  }
29211  return res;
29212 }
29213 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29214  Py_ssize_t ival;
29215  PyObject *x;
29216 #if PY_MAJOR_VERSION < 3
29217  if (likely(PyInt_CheckExact(b))) {
29218  if (sizeof(Py_ssize_t) >= sizeof(long))
29219  return PyInt_AS_LONG(b);
29220  else
29221  return PyInt_AsSsize_t(b);
29222  }
29223 #endif
29224  if (likely(PyLong_CheckExact(b))) {
29225  #if CYTHON_USE_PYLONG_INTERNALS
29226  const digit* digits = ((PyLongObject*)b)->ob_digit;
29227  const Py_ssize_t size = Py_SIZE(b);
29228  if (likely(__Pyx_sst_abs(size) <= 1)) {
29229  ival = likely(size) ? digits[0] : 0;
29230  if (size == -1) ival = -ival;
29231  return ival;
29232  } else {
29233  switch (size) {
29234  case 2:
29235  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29236  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29237  }
29238  break;
29239  case -2:
29240  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29241  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29242  }
29243  break;
29244  case 3:
29245  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29246  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29247  }
29248  break;
29249  case -3:
29250  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29251  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29252  }
29253  break;
29254  case 4:
29255  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29256  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29257  }
29258  break;
29259  case -4:
29260  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29261  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29262  }
29263  break;
29264  }
29265  }
29266  #endif
29267  return PyLong_AsSsize_t(b);
29268  }
29269  x = PyNumber_Index(b);
29270  if (!x) return -1;
29271  ival = PyInt_AsSsize_t(x);
29272  Py_DECREF(x);
29273  return ival;
29274 }
29275 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
29276  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
29277  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
29278 #if PY_MAJOR_VERSION < 3
29279  } else if (likely(PyInt_CheckExact(o))) {
29280  return PyInt_AS_LONG(o);
29281 #endif
29282  } else {
29283  Py_ssize_t ival;
29284  PyObject *x;
29285  x = PyNumber_Index(o);
29286  if (!x) return -1;
29287  ival = PyInt_AsLong(x);
29288  Py_DECREF(x);
29289  return ival;
29290  }
29291 }
29292 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29293  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29294 }
29295 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29296  return PyInt_FromSize_t(ival);
29297 }
29298 
29299 
29300 #endif /* Py_PYTHON_H */
Base class for linear operators. This class serves as interface for all derived classes.
int LongIndexType
Definition: types.h:60